Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道这是针对一种情况:
/bookstore/book[@price>20]
并且您可以使用第二组 [] 来指定位置:
/bookstore/book[@price>20][1]
但是如何在节点属性上指定多个条件?
以同样的方式,像
/bookstore/book[@price>20][1][@title!='']
您还可以使用and和or运算符
and
or
/bookstore/book[@price>20 and position() = 1 and @title!='']