[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Optional namespace declaration in 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|