Subject: Re: [xsl] Change Namespace of element and children From: Evan Lenz <evan@xxxxxxxxxxxx> Date: Wed, 31 Aug 2005 13:05:00 -0700 |
Hope this helps, Evan
Hi All, new to the list but not new to XSLT.
I want to change the namespace of an element using XSLT. My problem is, I can change the namepsace of a single element easily by doing a template match and then simply re-adding the element and specifying the new namespace ... like so:
<xsl:template match="MyElement"> <xsl:element name="MyElement" namespace="http://www.mystuff.com"> <xsl:apply-templates select="@*|*|text()"/> </xsl:element> </xsl:template>
But, the problem is, child elements of MyElement end up with the default (empty) namespace ... like so:
<MyElement xmlns=http://www.mystuff.com"> <MySubElement1 xmlns="">12345</MySubElement1> <MySubElement2 xmlns="">12345</MySubElement2> </MyELement>
Any ideas?
Thanks,
- Kevin
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Change Namespace of element a, Kevin L. Cobb | Thread | RE: [xsl] Change Namespace of eleme, Michael Kay |
Re: [xsl] excluding descendants (an, Evan Lenz | Date | RE: [xsl] Default namespace problem, Jacoby, Peter R. |
Month |