我有以下XML
<list>
<foo attr1="value" attr2="red"> </foo>
<foo attr1="xx" attr2="blue"> </foo>
<foo attr1="yy" attr2="green"> </foo>
</list>
Run Code Online (Sandbox Code Playgroud)
我想成为:
<list>
<foo attr1="value" attr2="red"/>
<foo attr1="xx" attr2="blue"/>
<foo attr1="yy" attr2="green"/>
</list>
Run Code Online (Sandbox Code Playgroud)
是否有一个XSLT选项用于从foo节点中删除空格?
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:strip-space elements="foo"/>
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
197 次 |
| 最近记录: |