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

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--    Category:     Variables
  3.     Sample from Zvon XSLT tutorial (www.zvon.org)  
  4.     Description:    A variable can hold a result tree fragment. The operations permitted on a result tree fragment
  5.        are a subset of those permitted on a node-set. An operation is permitted on a result tree fragment only if 
  6.        that operation would be permitted on a string (the operation on the string may involve first converting 
  7.        the string to a number or boolean). In particular, it is not permitted to use the /, //, and [] operators 
  8.        on result tree fragments. When a permitted operation is performed on a result tree fragment, it is performed 
  9.        exactly as it would be on the equivalent node-set.  -->
  10. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  11.     <xsl:variable name="A1">
  12.         <xsl:copy-of select="//TABLE[1]"/>
  13.     </xsl:variable>
  14.     <xsl:variable name="A2">
  15.         <xsl:copy-of select="//TABLE[2]"/>
  16.     </xsl:variable>
  17.     <xsl:template match="/">
  18.         <xsl:copy-of select="$A2"/>
  19.         <xsl:copy-of select="$A1"/>
  20.         <xsl:copy-of select="$A2"/>
  21.     </xsl:template>
  22. </xsl:stylesheet>
  23.