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

Extracting Unique element names and attributes from a

Subject: Extracting Unique element names and attributes from a XML file
From: "Ganesh Babu N" <nbabuganesh@xxxxxxxxx>
Date: Tue, 28 Oct 2008 15:08:07 +0530
 Extracting Unique element names and attributes from a
Hai All,

I need to list out all elements and attribute (unique) in a text file
for mapping with other XML file.

I am able to get all the elements and attributes but I am unable to
achieve the uniqueness. Can any body help on this.

I have tested with <xsl:sort> and not(preceding-sibling::* =
current()). Still I am unable to get the uniqueness.

My XSL is follows:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

	<xsl:output method="text"/>

	<xsl:template match="/">
		<xsl:for-each select="//*">
			<xsl:value-of select="local-name(.)"/>
			<xsl:text> </xsl:text>
			<xsl:choose>
				<xsl:when test="@*">
					<xsl:for-each select="@*">@<xsl:value-of
select="local-name(.)"/><xsl:text> </xsl:text>
					</xsl:for-each>
					<xsl:text>
					</xsl:text>
				</xsl:when>
				<xsl:otherwise>
					<xsl:text>
					</xsl:text>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

Regards,
Ganesh

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.