我需要从一个信封中提取一个XML。但我无法得到我预期的输出。我需要在输出中去掉命名空间。
我的输入:
<ns1:input xmlns:ns1="http://mysapmle.org/" xmlns="http://othersample.org/">
<sample>
<inner tc="5">Test</inner>
<routine>Always</routine>
</sample>
</ns1:input>
我的期望输出:
<sample>
<inner tc="5">Test</inner>
<routine>Always</routine>
</sample>
我的实际输出:
<sample xmlns="http://othersample.org/">
<inner tc="5">Test</inner>
<routine>Always</routine>
</sample>
我的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>
请帮忙。