I'm facing an issue while trying to change my XML namespace definition.
i have this namespace in my input xml : <ns3:DataElement xmlns:ns3="http://fakeurl_V3/xsd">
and lower in my xml i have a field : <productsList xsi:type="ns3:Segment" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
++++++++++++++++++++++++++++++++++++++++++++++++++ In my XSL i did this :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns2="http://fakeurl_V2/xsd"
xmlns:ns3="http://fakeurl_V3/xsd"
... others namespace ....
>
<xsl:output method="xml" version="1.0" omit-xml-declaration="no"
encoding="UTF-8" indent="yes" />
....
<xsl:template match="ns3:*">
<xsl:element name="ns2:{local-name()}">
<xsl:apply-templates select="@*|node()" />
</xsl:element>
</xsl:template>
....
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
there is the result :
<ns2:DataElement xmlns:ns2="http://fakeurl_V2/xsd">
<productsList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns3:Segment">
As you can see the namespace ns2 has been changed as i wish But it did not affect this line : xsi:type="ns3:Segment" that i need to transform in : xsi:type="ns2:Segment"
Do you have any solution about that ?
Thank you for your attention, i hope i made myself clear enougth.
Regards
xsi:type
attribute is not a namespace, but a meaningless string. You need to modify it using string manipulation. – michael.hor257k