我知道如何选择父元素的所有兄弟节点,我知道如何只选择一个。但是,如果有五个,我想按名称选择两个或三个呢?例如,给出这个样本xml片段:如何在XML中查询多个兄弟姐妹 - 但不是全部
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications with XML.</description>
</book>
我该如何选择节点BOTH标题和作者?
我可以通过使用/书/作者和标题通过使用/书/标题获得标题,但我如何将它们组合成一个查询,就像我会SQL查询:SELECT Author,Title from Book?
必须有类似的东西,不是吗?
该XML范例不正确显示,我将尝试再次在这里发布: – DennisQuestion
<书籍ID = “bk101”> Gambardella,马修
这是XPath问题吗?如果是这样,哪个版本? –