我将A:B节点重命名为C:D,但是在输出中,我正在查看 我不需要的C的完整名称空间
我尝试使用 排除结果前缀,但不起作用
<xsl:stylesheet Xmlns:A="http://www.deltaxml.com/ns/well-formed-delta-v1"
Xmlnx:C="http://www.deltaxml.com/ns/non-namespaced-attribute">
<xsl:template match="node()[name()='A:B']" mode="fetchData">
<xsl:element name="C:D" exclude-result-prefixes="merge">
<xsl:attribute name="content">
<xsl:variable name="A:B">
<xsl:value-of select="A:B" />
</xsl:variable>
<xsl:value-of select="$A:B" />
</xsl:attribute>
<xsl:apply-templates />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
XML从
<A:B xmlns:C="http://www.deltaxml.com/ns/non-namespaced-attribute"
content="Base>base</A:B>
<A:B xmlns:C="
http: / www.deltaxml.com / ns / non-namespaced-attribute "
content="Base1>base1</A:B>
<A:B xmlns:C="
http: / www.deltaxml.com / ns / non-namespaced-attribute "
content="Base2>base2</A:B>
到以下XML
<C:D xmlns:C="
http: / www.deltaxml.com / ns / non-namespaced-attribute "
content="Base>base</C:D>
<C:D xmlns:C="
http: / www.deltaxml.com / ns / non-namespaced-attribute "
content="Base1>base1</C:D>
<C:D xmlns:C="
http: / www.deltaxml.com / ns / non-namespaced-attribute " content="Base2>
base2
</C:D>
But I don't need the name space of C, Please suggest a solution