char *output = NULL;
poptContext pc;
int quiet = 0;
- int format_output = 0;
+ int format_output = 1;
struct poptOption options[] = {
POPT_AUTOHELP
{"debug", 'd', POPT_ARG_NONE, &debugging, 0, "Turn on debugging output" },
{"outputfile", 'o', POPT_ARG_STRING, &output, 0, "Write to specified file", "FILE" },
{"musicxml", 'm', POPT_ARG_NONE, &musicxml, 'm', "Output MusicXML" },
- {"format", 'f', POPT_ARG_NONE, &format_output, 1, "Format output" },
+ {"no-format", 'f', POPT_ARG_NONE, &format_output, 0, "Don't format output" },
{"quiet", 'q', POPT_ARG_NONE, &quiet, 1, "Be quiet (no output to stderr)" },
{"version", 'v', POPT_ARG_NONE, &version, 'v', "Show version information" },
POPT_TABLEEND
<?xml version='1.0'?>
<!--
PowerTab to MusicXML converter.
- (C) 2004 Jelmer Vernooij <jelmer@samba.org>
+ (C) 2004-2005 Jelmer Vernooij <jelmer@samba.org>
+ Published under the GNU GPL
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
version="1.1">
- <xsl:output method="xml" encoding="UTF-8" doctype-public="-//Recordare//DTD MusicXML 1.0 Partwise//EN" indent="yes" doctype-system="http://www.musicxml.org/dtds/partwise.dtd"/>
+ <xsl:output indent="yes" method="xml" encoding="UTF-8" doctype-public="-//Recordare//DTD MusicXML 1.0 Partwise//EN" doctype-system="http://www.musicxml.org/dtds/partwise.dtd"/>
<xsl:template match="powertab">
<xsl:element name="score-partwise">
- <xsl:element name="part-list">
-
- </xsl:element>
- <xsl:apply-templates/>
+ <xsl:call-template name="identification"/>
+ <xsl:call-template name="part-list"/>
+ <xsl:for-each select="instrument">
+ <xsl:call-template name="part"/>
+ </xsl:for-each>
</xsl:element>
</xsl:template>
- <xsl:template match="sections">
- <xsl:apply-templates/>
+ <xsl:template name="part">
+ <xsl:element name="part">
+ <xsl:attribute name="id">
+ <xsl:text>P</xsl:text>
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="sections"/>
+ </xsl:element>
</xsl:template>
<xsl:template match="words-by">
</xsl:element>
</xsl:template>
- <xsl:template match="guitar-transcribed-by|bass-transcribed-by"/>
-
- <xsl:template match="header">
+ <xsl:template name="part-list">
+ <xsl:element name="part-list">
+ <xsl:for-each select="instrument">
+ <xsl:element name="score-part">
+ <xsl:attribute name="id"><xsl:text>P</xsl:text><xsl:value-of select="@id"/></xsl:attribute>
+ <xsl:element name="part-name">
+ <xsl:choose>
+ <xsl:when test="@id=0">
+ <xsl:text>Guitar</xsl:text>
+ </xsl:when>
+ <xsl:when test="@id=1">
+ <xsl:text>Bass</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="identification">
<xsl:element name="identification">
- <xsl:apply-templates/>
+ <xsl:for-each select="header/*">
+ <xsl:apply-templates/>
+ </xsl:for-each>
<xsl:element name="encoding">
- <xsl:for-each select="song/guitar-transcribed-by|song/bass-transcribed-by">
+ <xsl:for-each select="header/song/guitar-transcribed-by|header/song/bass-transcribed-by">
<xsl:element name="encoder">
<xsl:apply-templates/>
</xsl:element>
</xsl:element>
</xsl:template>
- <xsl:template match="song/title"/>
- <xsl:template match="song/artist"/>
+ <xsl:template match="song/title"><!--FIXME-->
+ </xsl:template>
+ <xsl:template match="song/artist"><!--FIXME-->
+ </xsl:template>
+
+ <xsl:template match="sections"><xsl:apply-templates/></xsl:template>
<xsl:template match="section">
- <xsl:element name="part">
+ <xsl:element name="measure">
+ <xsl:attribute name="number"><xsl:text>1</xsl:text></xsl:attribute>
</xsl:element>
</xsl:template>
+ <xsl:template match="fonts">
+ <!-- Ignore fonts -->
+ </xsl:template>
+
+ <xsl:template match="*">
+ <xsl:message>
+ <xsl:text>No template matches </xsl:text>
+ <xsl:value-of select="name(.)"/>
+ <xsl:text>.</xsl:text>
+ </xsl:message>
+ </xsl:template>
</xsl:stylesheet>