I need to extract XML from an envelope. But I canβt get my intended result. I need to get rid of namespaces in my release.
My details:
<ns1:input xmlns:ns1="http://mysapmle.org/" xmlns="http://othersample.org/"> <sample> <inner tc="5">Test</inner> <routine>Always</routine> </sample> </ns1:input>
My expected result:
<sample> <inner tc="5">Test</inner> <routine>Always</routine> </sample>
My actual output is:
<sample xmlns="http://othersample.org/"> <inner tc="5">Test</inner> <routine>Always</routine> </sample>
My XSLT:
<xsl:output omit-xml-declaration="yes" indent="yes" /> <xsl:template match="/"> <xsl:copy copy-namespaces="no"> <xsl:apply-templates select="//sample" /> </xsl:copy> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy copy-namespaces="no"> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:template>
Please, help.
user1985027
source share