开发者

xpath for-each multiple conditions

开发者 https://www.devze.com 2022-12-23 08:21 出处:网络
What is wrong with the following line? <xsl:for-each select=\"//Node1/Node2/Node3 [.!=\'Primary\' or .!=\'Secondary\' ]\">

What is wrong with the following line?

<xsl:for-each select="//Node1/Node2/Node3 [.!='Primary' or .!='Secondary' ]">

Trying to select all elements where Node3 is not Prim开发者_StackOverflowary o Secondary.

Thanks.


I think you want to find Node3 where the content is not Primary and not Secondary.

<xsl:for-each select="//Node1/Node2/Node3[.!='Primary' and .!='Secondary' ]">


not(. = 'Primary' or . = 'Secondary')

:)

0

精彩评论

暂无评论...
验证码 换一张
取 消