home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / samples / debugger / Variables / sample2.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-07-21  |  949 b   |  24 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--    Category:     Variables
  3.     Sample from Zvon XSLT tutorial (www.zvon.org)  
  4.     Description:    This stylesheet demonstrate setting of xsl:param -->
  5. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6.     <xsl:param name="totalChapters" select="count(//chapter)"/>
  7.     <xsl:template match="/">
  8.         <TABLE>
  9.             <xsl:for-each select="//chapter">
  10.                 <TR>
  11.                     <TD>
  12.                         <xsl:value-of select="."/>
  13.                         <xsl:text> (</xsl:text>
  14.                         <xsl:value-of select="position()"/>
  15.                         <xsl:text>/</xsl:text>
  16.                         <xsl:value-of select="$totalChapters"/>
  17.                         <xsl:text>)</xsl:text>
  18.                     </TD>
  19.                 </TR>
  20.             </xsl:for-each>
  21.         </TABLE>
  22.     </xsl:template>
  23. </xsl:stylesheet>
  24.