【发布时间】:2010-09-23 23:31:46
【问题描述】:
我想从 XML 中删除所有元素,但名为
<root>
<a>This will be stripped off</a>
<source>But this not</source>
</root>
XSLT 之后:
But this not
我已经尝试过了,但没有运气(没有输出):
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="source">
<xsl:copy>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
</xsl:stylesheet>
来自 cmets:
在我真正的 XML 中,我有源代码 不同命名空间中的元素。我需要 谷歌如何创建匹配 不同元素的模式 命名空间。我想把每个 提取的字符串也换行;-)
【问题讨论】: