home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
- <!-- Run this stylesheet against Test.xml -->
-
- <xsl:template match="/">
- <root>
- <xsl:apply-templates select="root/A"/>
- </root>
- </xsl:template>
-
- <!-- only select A elements that have a child B element -->
- <!-- where the B element text contains the word 'SHOULD' -->
- <xsl:template match="A[B[contains(text(),'SHOULD')]]">
- <xsl:copy-of select="."/>
- </xsl:template>
-
- <xsl:template match="A">
- <!-- this template does nothing! -->
- <!-- so that A elements that do not match the -->
- <!-- previous template are not sent to the -->
- <!-- XSLT built-in rules -->
- </xsl:template>
-
- </xsl:stylesheet>