I'm looking at the w3c bookstore xpath example here.
Based on that xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
I am trying to do this with XPath:
"Does this XML docuement have a book that has an author 'James McGovern' and a price of '49.99' AND does this XML document also have a book that has an author 'Erik T. Ray' and a price of '39.95'
That human statement is true, what is the XPath equivalent? Is it possible to run expressions across sibling nodes, and if so, how?
To clarify, in other languages, one might do something like this:
(author1 = 'James McGovern' and price1 = '49.99') and (author2 = 'Erik T. Ray' and price2 = '39.95')
Where author1\price1 are children of:
<book category="WEB">
with title: <title lang="en">XQuery Kick Start</title>
And author2\price2 are children of:
<book category="WEB">
with title: <title lang="en">Learning XML</title>
] and [
makes no sense for me. What are you expecting from that? – hek2mglor
in this case – hek2mgland
but of the cousin book node. – javamonkey79(author = 'James McGovern' and price = '49.99') and (author = 'Erik T. Ray' and price = '39.95')
is logically impossible. How should the price for example being49.99
and39.95
at the same time? – hek2mgl