在XSL中是否可以在运行时更改文档(root-node)属性的值?
像这样:
<Document xmlns="http:\\someURL.com" xmlns:xsi="http://www.w3.org">至:
<Document xmlns="urn:iso:std:iso" xmlns:xsi="http://www.w3.org">发布于 2013-08-14 11:08:47
xmlns不是一个属性,它是文档名称空间。
(有时,具有key=value格式的名称空间声明或部分处理指令在语法上看起来与属性相似,称为伪属性。)
但您可以复制一个元素,并使用以下内容在不同的名称空间中声明它:
<xsl:template match="*">
<xsl:element name="{local-name()}" namespace="urn:iso:std:iso" >
<xsl:apply-templates select="@*" />
<xsl:apply-templates />
</xsl:element>
</xsl:template>https://stackoverflow.com/questions/18222107
复制相似问题