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

RE: Namespace declarations in XML

Subject: RE: Namespace declarations in XML
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Wed, 16 Mar 2005 13:28:04 -0000
xsl namespace xml
> I have a client passing me a feed with a top-level element
> that looks like this:
> <ArrayOfProductType
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://catalog.9squared.com">
> Now, am I mistaken in thinking that namespace declarations
> are inappropriate in an XML feed? And if I am mistaken, how
> do I work with that? I even duplicated these namespace
> declarations in my xsl and then pointed them to resolve to
> the xsl namespace, but I am still getting nothing to output.

All elements in the above feed are in the 'http://catalog.9squared.com'
namespace, so in order to match them you will have to declare that
namespace in your stylesheet, give it a prefix and then match elements
with that prefix:

<xsl:stylesheet xmlns:foo="http://catalog.9squared.com" ......

And then:

<xsl:template match="foo:whatever">.....

Read here for more 'Matching nodes in the default namespace' info:



Current Thread


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.
First Name
Last Name
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.