Reputation: 2781
<category>
<Movi Name="Test">
<Price>$3.95</Price>
</Movi>
<Movi Name="test d">
<Price>$13.95</Price>
</Movi>
</category>
can anyone help on this XML to find movie greater than $11 with XPath
Upvotes: 1
Views: 378
Reputation: 24928
Just for the sake of completeness, another option is:
//Price[number(translate(text(), '$','')) > 11]
Upvotes: 0
Reputation: 1012
Given all prices are in the same currency and format, this bit of XPath does the job:
/category/Movi[number(substring(./Price/text(), 2)) > 11]
Upvotes: 2