[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Easy way to identify node type?
Is there an easy way (or any way at all) to identify the type of the node being processed? Suppose, for instance, that you wanted to produce different output for different node types, as in the *fictitious* example below: <xsl:template match="root"> <xsl:for-each select="node()"> <xsl:choose> <xsl:when test="node-type() = 'ELEMENT'"> <xsl:text>blah, blah</xsl:text> </xsl:when> <xsl:when test="node-type() = 'TEXT'"> <xsl:value-of select="."/> </xsl:when> ... </xsl:choose> </xsl:for-each> </xsl:template> Is there a way to do that? Thanks in advance for your input, Erik XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|