I need to have a list contains function in xpath which will work like this:
//*[contains( ("one", "two", "three"), "one")
Is there anything like this?
Just for context, this is the problem I am trying to solve:
I have got a DOM tree
<element blah="one two three">
<element blah="bone two th开发者_如何学Goree">
<element blah="two three one">
I want to select the first and third because they cone contain one.
//*[contains(tokenize(@blah,'\s+'),'one')]
This is what I have so far, but it doesn't seem to be a valid XPath query.
I know that tokenize returns something in this format:
("one", "two", "three")
What I need is to be able to check what is in that list.
Simple:
"one" = ("one", "two", "three")
Or the more lengthy:
some $i in ("one", "two", "three") satisfies $i eq "one"
精彩评论