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

Wanted: All unique namespaces in a document

Subject: Wanted: All unique namespaces in a document
From: "Ingo Macherius" <macherius@xxxxxxxxxxxxxxxx>
Date: Wed, 5 Apr 2000 04:12:42 +0200
all about namespaces
Hi,

I'm trying to write an XSLT sheet extracting all unique namespaces used in a
document. My processors of choice are Xalan 1.0.0 and SAXON, as current XT
does not support the namespace:: axis. The results are, err, quite random.
And I haven't tried Oracle yet :)

(1) First attempt:

		<xsl:for-each select="//namespace::*">
			<xsl:value-of select="."/>
		</xsl:for-each>

In Xerces, this yields a namespace-uri for each element with an xmlns:foo
attribute (including doublets). In SAXON it outputs many, many
namespace-uri. I guess it may return all namespaces visible from each
element.

(2) Second attempt:

		<xsl:for-each select="
			//*
				[not( namespace-uri(.) = namespace-uri(preceding::.))]
			">

			<xsl:value-of select="namespace-uri(.)"/>
		</xsl:for-each>

Fails in SAXON (illegal construct preceding::.). In Xerces it does not fail,
and returns the namespace URI string for each element in the document.

Anyone with a clue for a solution that (at least in theory) works ?

Regards,
	++im


 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.