【发布时间】:2013-06-13 20:51:19
【问题描述】:
我有一些 XML,如下所示:
<region class="TableInfo">
text
</region>
<region>
text
</region>
我想编写只保留没有 class="TableInfo" 的那部分的 XSL。
我尝试了许多不同的方法,包括:
<xsl:for-each select="region[class!='TableInfo']">
</xsl:for-each>
和
<xsl:for-each select="region">
<xsl:if test="not(class='TableInfo')">
</xsl:if>
</xsl:for-each>
及其几种变体。似乎它以某种方式评估为一个值而不是一个字符串,因为当我将其设置为 != 测试时,所有内容都会被删除,而当我将其设置为 not() 时,什么都不会被删除。有什么帮助吗?
谢谢!
【问题讨论】:
标签: string xslt if-statement