Sunday, 19 October 2014

Selecting an element whose sibling contains an attribute XML



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



  1. learning XML

  2. 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>

No comments:

Post a Comment