home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / samples / debugger / Templates / sample1.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-07-21  |  1.2 KB  |  33 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--    Category:       Templates
  3.     Sample from Zvon XSLT tutorial (www.zvon.org)  
  4.     Description:    With modes an element can be processed multiple times, each time producing a different result. -->
  5. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6.     <xsl:template match="/">
  7.         <xsl:apply-templates select="//CCC" mode="red"/>
  8.         <xsl:apply-templates select="//CCC" mode="blue"/>
  9.         <xsl:apply-templates select="//CCC"/>
  10.     </xsl:template>
  11.     <xsl:template match="CCC" mode="red">
  12.         <div style="color:red">
  13.             <xsl:value-of select="name()"/>
  14.             <xsl:text> id=</xsl:text>
  15.             <xsl:value-of select="@id"/>
  16.         </div>
  17.     </xsl:template>
  18.     <xsl:template match="CCC" mode="blue">
  19.         <div style="color:blue">
  20.             <xsl:value-of select="name()"/>
  21.             <xsl:text> id=</xsl:text>
  22.             <xsl:value-of select="@id"/>
  23.         </div>
  24.     </xsl:template>
  25.     <xsl:template match="CCC">
  26.         <div style="color:purple">
  27.             <xsl:value-of select="name()"/>
  28.             <xsl:text> id=</xsl:text>
  29.             <xsl:value-of select="@id"/>
  30.         </div>
  31.     </xsl:template>
  32. </xsl:stylesheet>
  33.