This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm trying to produce another XML from an existing XML using XSLT (XML + XSLT = XML), and I'm experiencing namespaces issue. I'm new to this, so I guess the solution might be easy, anyways I'm still confused about handling this.
Scenario A: --- XML input: <metadata xmlns="http://www.mycompany.com/schema/odsload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
I suppose there is more code in your XSLT than you actually posted there. Probably it is trying to match on element names. When you match on an element name, you are trying to match that name with no namespace (that's an XPath 1.0 default). That fails to match that name in the default namespace, which is what's going on in the first example.
Joined: May 16, 2003
Thanks for replying Paul. Do you know a better solution for addressing this issue, once I can't modify the XML input? Adding "ds" to xmlns is definitely an ugly workaround
Instead ofwhich doesn't match a "thing" element in the default namespace, you can do this:That matches either a "thing" element in the default namespace or a "thing" element not in any namespace. [ May 03, 2007: Message edited by: Paul Clapham ]