Problem with XSLT where source xml document uses d

2020-04-06 01:04发布

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">

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

1条回答
再贱就再见
2楼-- · 2020-04-06 01:52

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.

查看更多
登录 后发表回答