I'm trying to select the title value where the attribute value is greater than 1:
path="//book/price[@value >1]
I'm not exactly sure how to select only the titles where the attribute value for the element price is greater than one. I'm an XML beginner and I'm doing a few exercises from a tutorial.
My priorities are
- learning XML
- super XML
XML:
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<price value="1">49.99</price>
</book>
<book>
<title lang="en">Learning XML</title>
<price value="2">29.95</price>
</book>
<book>
<title lang="en">super xml</title>
<price value="3">39.95</price>
</book>
</bookstore>
Update
The first query was perfect could you show me how to obtain it from a nested element?
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<possibleprice>
<price value="1">49.99</price>
</possibleprice>
</book>
<book>
<title lang="en">Learning XML</title>
<possibleprice>
<price value="2">29.95</price>
</possibleprice>
</book>
<book>
<title lang="en">super xml</title>
<possibleprice>
<price value="3">39.95</price>
</possibleprice>
</book>
</bookstore>