Tutorial: XSL produces SVG<br/><span class='r'>With answers</span>
Zoo tutorials: [ SQL | Java | Linux | XML ]

A Gentle Introduction to xml

XSL produces SVG
With answers

Question 1: Introducing SVG

The XSL sheet given is the identity. Any SVG in the input is simply copied to the output.

Untick the "show as text" box to see the SVG.
  1. Change the angle of rotation in the XML.
  2. Replace the rotation in the XML with a rot tag. This is not part of SVG - we must implement this new element in XSL.
      <rot> 
       <text font-size="55">Hello world</text>
      </rot>
    
    Insert this template into the XSL - it should replace the rot element with the appropriate SVG.
    <xsl:template match="rot">
    <g transform="rotate(90)">
      <xsl:apply-templates/>
    </g>
    </xsl:template>
    
  3. Insert <xsl:copy-of select="*"/> to the top of the new template so that we get an unrotated copy of the text.
  4. Insert two more copies of the <g tranform...> elements so that we get four rotated versions in all with 0, 90, 180 and 270 rotations.

XML


XSL