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

Optional namespace declaration in XML document

Subject: Optional namespace declaration in XML document
From: "h e ayestaran" <H.E.Ayestaran@xxxxxxxxxxxxxxx>
Date: Tue, 28 Feb 2006 15:52:41 -0000
adding namespace to xml document
Hi,

Is there any way to have one XSLT 1.0 stylesheet handle situations where the
XML input has different namespace declarations? In particular, I want to be
able to use the same stylesheet to parse data which (because the standard is
still only loosely supported by the various packages that claim to support it)
can contain different namespace declarations (or no declaration at all) in the
XML file. For all intents and purposes, the data structure is the same,
regardless of the namespace declared. For example the data might be:

<mydata xmlns="myns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="myns myns.xsd">
  <mydataitem>sample data</mydataitem>
 </mydata>

or

<mydata xmlns="otherns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="otherns otherns.xsd">
  <mydataitem>sample data</mydataitem>
</mydata>

or simply

<mydata>
  <mydataitem>sample data</mydataitem>
</mydata>

(it's possible I made a mistake there, as it is obviously fictitious data). I
can think of ways to get around the problem, but it seems ludicrously
complicated. Is there a simple solution? Cheers,

Enrique

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.