[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Easy way to identify node type?

Subject: Easy way to identify node type?
From: yguaba@xxxxxxxxxxxx
Date: Thu, 04 Dec 2003 14:23:16 -0200
xsl 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.