views:

330

answers:

1

Have a source xml document that uses namespace containing prefixes and a default namespace. When I transform it using a XSLT doc, the resulting translated xml document is incorrect, that is, element data from the source xml document is missing.

When I remove the "default namespace" from the source xml document, the transformation works as expected.

Question: is there a way to resolve problem without the need to edit out the default namespace from the source xml document? That is, add the solution to the XSLT document.

XML Document:

<MyElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.zolldata.com/UDX"&gt;

where the problem default namespace is xmlns="http://www.zolldata.com/UDX"

+3  A: 

Specify same default namespace in XSLT document if your selectors do not use prefixes, or use prefixes for all selectors in the XSLT, but don't forget to bind them to the default namespace of your XML document.

Sergey Ilinsky
I would add the default namespace, xmlns="http://www.zolldata.com/UDX", to my XSLT document.How would I bind? what am I binding?
Larry