Previous    Next

musiclist4b.svg - Result


musiclist3c.xml

musiclist.xml

musiclist3c.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" 
href="musiclist.xsl"?> <module> <list> <item>melody</item> <item>harmony</item> <item>rhythm</item> <item>tonality</item> <item>instrumentation</item> <item>orchestration</item> <item>texture</item> <item>structure</item> </list> </module>

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" 
href="musiclist.xsl"?> <module> <list> <item number="1">melody</item> <item number="2">harmony</item> <item number="3">rhythm</item> <item number="4">tonality</item> <item number="5">instrumentation</item> <item number="6">orchestration</item> <item number="7">texture</item> <item number="8">structure</item> </list> </module>

musiclist4bsvg.xsl - extract


  <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 &gt; 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 &gt; 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>

musiclist4b.svg - Extract

<?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>

musiclist4b.svg - Result


Previous    Next