xslt-2.0 - 重命名节点时附加完整命名空间的问题
问题描述
我将 A:B 节点重命名为 C:D 但在输出中,我正在查看我不需要的 C 的完整命名空间
我尝试使用 exclude-result-prefixes 但它不起作用
<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
解决方案
推荐阅读
- python - 如何在 FastAPI 中获取定义的路由路径?
- javascript - 当 argon2 添加到您的解决方案时,是什么导致 rollupjs 中“无法读取未定义的‘类型’的属性”
- r - 如何在嵌套循环中对 data.table 中的空单元格进行分配?
- python - Gunicorn 进程不断分叉,直到内存不足
- java - ElasticsearchTemplate 和 Resthighlevelclient 的区别
- node.js - TRC-20 事件监听器中不包含所有事件
- java - 将文件和文件夹添加到 WAR 文件中的特定位置
- javascript - 如何在一个函数中调用多个 eventType?
- html - 如何在按钮之间垂直放置一些空间?
- python - 歌词的NER模型[说唱]