not
not 函数会计算一个布尔表达式并返回相反的值。
语法
not( expression )
参数
返回值
对于计算结果为 false 的表达式返回 true;对于计算结果为 true 的表达式返回 false。
描述
-
除了返回相反的值之外,此函数的功能应与 boolean() 函数类似。
-
您可以测试一个元素是否不具有某个属性。
xml<xsl:for-each match="//a[not(@name and @name = 'badname')]"> <!-- iterates over any <a> element in the document, that either has no 'name' attribute at all, or it has one, but its value is not "badname". --> </xsl:template>
规范
Gecko 支持情况
支持。