首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

not()

XSLT / XPath参考:XSLT元素, EXSLT函数,XPath函数,XPath轴

not函数计算布尔表达式并返回相反的值。

句法

代码语言:javascript
复制
not(expression )

参数

_ expression表达式的计算方式与将其作为参数传递给boolean()函数时一样。

返回

对于评估为false的表达式为真; 对于计算结果为true的表达式为false。

注意

  • 除了它返回相反的值之外,该函数的行为与boolean()函数类似。
  • 您可以测试某个元素是否没有某个属性。
代码语言:javascript
复制
<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支持

支持的。

扫码关注腾讯云开发者

领取腾讯云代金券