Issue
I practice in building xpath expression. I found the following task:
Select the small apple and the big orange
<div class='table'>
<plate id="fancy">
<apple class="small"/>
</plate>
<plate>
<orange class="small"/>
<orange/>
</plate>
<pickle class="small"/>
</div>
I can't understand why the following expression doesn't solve the question:
//apple[@class='small']|//orange[last()]
Solution
This site is very opinionated, i.e. it does not accept all correct answers, but only specific ones.
What they want here is:
//plate[@id='fancy']/apple | //orange[last()]
Answered By - thorndeux
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.