XPath “in” operator

后端 未结 3 1911
误落风尘
误落风尘 2021-01-17 22:57

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)
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-17 23:45

    I had the same problem, the above answer is right. To make it more clear, in Xpath this will look something like:

    //*:document[*:documentType=("magazine","newspaper")]
    

    wich would be the equivalant of:

    select * from documents where documenttype in ('newsletter','magazine')
    

提交回复
热议问题