<bookstore>
<book category="fiction">
<title lang="en">Introduction to XPath</title>
<author>John Doe</author>
<price>29.95</price>
</book>
<book category="non-fiction">
<title lang="fr">XPath and You</title>
<author>Jane Smith</author>
<price>19.99</price>
</book>
<book category="fiction">
<title lang="en">Advanced XPath Techniques</title>
<author>Bob Johnson</author>
<price>39.99</price>
</book>
</bookstore>
下面是一些基于XPath的查询示例:
1. 选择所有书籍的标题:
/bookstore/book/title
结果: