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

Stylesheet to output XML Tags (node names)

Subject: Stylesheet to output XML Tags (node names)
From: "António Mota" <amsmota@xxxxxxxxx>
Date: Thu, 20 Apr 2006 12:12:32 +0100
xslt output node name
I've made this little stylesheet to output XML Tags (node names). Is
it OK, from the point of view of functionality/performance?

I did noticed (or so it seems to me) that changing the select clauses to

*[generat-id(.)=generate-id(key('tags', name())]

will slow down the processing...



<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
	<xsl:key name="tags" match="*" use="name()" />
	<xsl:template match="/">
		<nodetags>
			<xsl:apply-templates select="*[count(. | key('tags', name())[1]) = 1]"/>
		</nodetags>
	</xsl:template>
	<xsl:template match="*">
		<tag>
			<xsl:value-of select="name()" />
		</tag>
		<xsl:apply-templates select="*[count(. | key('tags', name())[1]) = 1]"/>
	</xsl:template>
</xsl:transform>

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.