XSL sample

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
  <html>
  <head>
  <title>Eli Tomer - XML validation by schema and formatted by XSL</title>
  <link REL="stylesheet" TYPE="text/css" HREF="poemse.css" TITLE="Default"/>
  <meta name="keywords" content="eli tomer, poems, xml sample, xsl formating, using css"/>
  <meta name="Description" content="poems by Eli Tomer in XML, formated by XSL "/>
  </head>

  <body>
  <a name="top"/>

  <!-- page introduction begins here.  -->
  <div class="introc">
  <h3>Eli Tomer: Selected Poems in XML</h3>
  <h4>Validated by schema poemse.xsd and formatted by poemse.xsl</h4>
  <a target="_top" href="index.html"><img alt="goto Hompage" src = "home_btn.gif"/>To homepage</a><br/>
  </div>

  <div class="introl">
  <!-- table of contents: get poem titles from source xml and put it as an internal link -->
  <xsl:for-each select="//poem/@pname">
    <br/><a>
    <xsl:attribute name="href">#<xsl:value-of /></xsl:attribute><xsl:value-of /> 
    </a><br/>
  </xsl:for-each>
  </div>
  <xsl:apply-templates select="//poem"/>

  </body>
 </html>
</xsl:template>

<xsl:template match="poem" > 
  <hr/><br/>
  <!-- get poem titles from source xml and write the anchors + link to audio -->
  <a><xsl:attribute name="name"><xsl:value-of select="@pname"/></xsl:attribute></a>

  <a><xsl:attribute name="href"><xsl:value-of select="@audio"/>.wav</xsl:attribute>
     <img alt="Play Audio" src = "sound.gif"/></a>

  <span class="pname"><xsl:value-of select="@pname"/></span>

  <xsl:apply-templates select="stanza"/>
  <br/><br/>

  <a href="#top"><img alt="goto top" src = "go_top_b.gif"/></a>top 
</xsl:template>

<xsl:template match="stanza">
  <br/>
  <xsl:apply-templates select="line"/>
</xsl:template>

<!-- now the real stuff: put the poem lines here -->
<xsl:template match="line">
  <br/><xsl:value-of/>
</xsl:template>

</xsl:stylesheet>
goto HompageTo homepage