Is there is an operator in XPath 1.0 that acts as “in” operator in SQL?
select * from tbl_students where id in (1,2,3)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The = operator of XPath 1.0 works that way, though XPath 1.0 doesn’t provide syntax for writing sequences. So if you have an XML document of the form
then an expression like
//doc[value = 2]will return thatdocelement.In XPath 2.0, the syntax
(1, 2, 3)will create a sequence of three integers, and you can write conditions like$i = (1, 2, 3). But literal sequences are not a feature of XPath 1.0 — the only way to get multiple values on one side of an XPath expression is to use a path expression that matches multiple nodes.