musiclist.xml |
musiclist3c.xml |
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" |
<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" |
<xsl:template match="module">
...
<svg>
<desc>List of Music Properties</desc>
<xsl:apply-templates/>
</svg>
</xsl:template>
<xsl:template match="item">
<xsl:if test="@number mod 2 = 0">
<rect>
<xsl:choose>
<xsl:when test="@number = 2">
<xsl:attribute name="transform">translate(250
<xsl:value-of select="((@number - 1)*70)-60"/>)</xsl:attribute>
</xsl:when>
<xsl:when test="@number > 2">
<xsl:attribute name="transform">translate(250
<xsl:value-of select="((@number div 2)*70)-60"/>)</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:attribute name="x">0</xsl:attribute>
<xsl:attribute name="y">0</xsl:attribute>
<xsl:attribute name="width">200</xsl:attribute>
<xsl:attribute name="height">50</xsl:attribute>
<xsl:attribute name="class">rectangle</xsl:attribute>
</rect>
<text>
...
</text>
</xsl:if>
<xsl:if test="@number mod 2 > 0">
<rect>
<xsl:if test="@number = 1">
...
</xsl:if>
<xsl:if test="@number > 1">
<!-- ideally <xsl:value-of select="((@number quo 2) + 1)*70)-130"/> but this didn't work with XT -->
<xsl:attribute name="transform">translate(20
<xsl:value-of select="((round(@number div 2) + 1)*70)-130"/>)</xsl:attribute>
</xsl:if>
...
</rect>
<text>
...
</text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="style1.css" type="text/css"?> <svg> <desc>List of Music Properties<?/desc> <g transform="scale(0.75)"> <rect transform="translate(20 10)" x="0" y="0" width="200" height="50" class="rectangle"/> <text transform="translate(45 35)" x="0" y="0" class="recttext">melody</text> <rect transform="translate(250 10)" x="0" y="0" width="200" height="50" class="rectangle"/> <text transform="translate(275 35)" x="0" y="0" class="recttext">harmony</text> ... <rect transform="translate(20 220)" x="0" y="0" width="200" height="50" class="rectangle"/> <text transform="translate(45 245)" x="0" y="0" class="recttext">texture</text> <rect transform="translate(250 220)" x="0" y="0" width="200" height="50" class="rectangle"/> <text transform="translate(275 245)" x="0" y="0" class="recttext">structure</text> </g> </svg>