home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F26554_Test2.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-09-28  |  846 b   |  25 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
  4. <!-- Run this stylesheet against Test.xml -->
  5.  
  6. <xsl:template match="/">
  7.   <root>
  8.     <xsl:apply-templates select="root/A"/>
  9.   </root>
  10. </xsl:template>
  11.  
  12. <!-- only select A elements that have a child B element  -->
  13. <!-- where the B element text contains the word 'SHOULD' -->
  14. <xsl:template match="A[B[contains(text(),'SHOULD')]]">
  15.   <xsl:copy-of select="."/>
  16. </xsl:template>
  17.  
  18. <xsl:template match="A">
  19.     <!-- this template does nothing!              -->
  20.     <!-- so that A elements that do not match the -->
  21.     <!-- previous template are not sent to the    -->
  22.     <!-- XSLT built-in rules                      -->
  23. </xsl:template>
  24.  
  25. </xsl:stylesheet>