functx:删除属性添加一个空的xmlns

问题描述 投票:2回答:1

函数functx:remove-attributes自动向节点添加一个空的[[@xmlns]],我想防止这种情况。范例xml:<mei meiversion="3.0.0" xmlns="http://www.music-encoding.org/ns/mei"> <note accid.ges="f" doxml.id="d28e18935" dur="8" oct="4" pname="e" tstamp="1.75" xml:id="note_112296"/> </mei>

XSLT摘录:

<xsl:copy-of select="functx:remove-attributes(., $attributes2remove)" />

当前(假)XML输出:

<note accid.ges="f" doxml.id="d28e18935" dur="8" oct="4" pname="e" tstamp="1.75" xml:id="note_112296" xmlns=""/>

函数functx:remove-attributes自动向节点添加一个空@xmlns,我想防止这种情况。 xml示例:
xml xslt xml-namespaces functx
1个回答
1
投票
在功能主体中,我想您想使用xsl:copy而不是xsl:element
© www.soinside.com 2019 - 2024. All rights reserved.