Guest User

Select first instance only with XPath

a guest
Feb 26th, 2012
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <root>
  2. <some_gunk/>
  3. <dupe_node>
  4. ...
  5. stuff I want
  6. ...
  7. </dupe_node>
  8. <bits_and_pieces/>
  9. <other_gunk/>
  10. <dupe_node>
  11. ...
  12. stuff I don't want
  13. ...
  14. </dupe_node>
  15. <more_gunk/>
  16. </root>
  17.  
  18. /descendant::dupe_node[1]
  19.  
  20. <foo>
  21. <bar/>
  22. <foo>
  23. <bar/>
  24. </foo>
  25. </foo>
  26.  
  27. //dupe_node[1]
Add Comment
Please, Sign In to add comment