Replace and get rid of specific XML namespace
Posted: Wed Feb 27, 2008 2:31 pm
I have an XML file which uses mostly standard XML namespace (call it xml:standard) and some additional elements defined by a proprietary XSD which extends the standard one (call it xml:prop).
Now I need to create a XSLT that transforms the incoming XML with proprietary elements into a standard one, replacing the proprietary elements so that they fit into the standard schema (the details are not important here, I know how to implement the transformation).
The problem is that in the resulting XML, there are still references to the xml:prop namespace, namely:
<someStandardElement xmlns="standard-namespace" xmlns:prop="proprietary-namespace">
How to get rid of them in the proper way? I tried messing with <xsl:namespace-alias> using syntax like:
<xsl:namespace-alias stylesheet-prefix="prop" result-prefix="standard"/>
or
<xsl:namespace-alias stylesheet-prefix="prop" result-prefix="#"/>
but without success.
Now I need to create a XSLT that transforms the incoming XML with proprietary elements into a standard one, replacing the proprietary elements so that they fit into the standard schema (the details are not important here, I know how to implement the transformation).
The problem is that in the resulting XML, there are still references to the xml:prop namespace, namely:
<someStandardElement xmlns="standard-namespace" xmlns:prop="proprietary-namespace">
How to get rid of them in the proper way? I tried messing with <xsl:namespace-alias> using syntax like:
<xsl:namespace-alias stylesheet-prefix="prop" result-prefix="standard"/>
or
<xsl:namespace-alias stylesheet-prefix="prop" result-prefix="#"/>
but without success.