Xpath that evaluates -all- attributes?
- by Tres
I maybe be trying to do something invalid here, but maybe someone smarter than me knows the correct syntax to solve my problem.
Given:
<group code="vehicle">
<line code="car">
<cell>
<box code="price">1000.00</box>
</cell>
</line>
<line code="car">
<cell code="sports">
<box code="price">500.00</box>
</cell>
</line>
</group>
If I use //*[@code="vehicle"]//*[@code="car"]//*[@code="price"], I will get both boxes returned (1000.00 and 500.00)--as expected but not what I want.
Is there an xpath syntax that will evaluate against all nodes that have an attribute of @code rather than skipping it if it doesn't match with the end result being that I only get back the first box (price of 1000.00)? Like asking, choose the first node with @code and that @code must equal "vehicle", then choose the next node with @code and that @code must equal "car", then choose the next node with @code and @code must equal "price".