My Snippets

Get last element in an XML element list

XML:
  1. <car>
  2.   <wheel name="frontleft">FL</wheel>
  3.   <wheel name="frontright">FR</wheel>
  4.   <wheel name="backleft">BL</wheel>
  5.   <wheel name="backright">BR</wheel>
  6. </car>

xpath: //wheel[last()=position()]
=>

XML:
  1. <wheel name="backright">BR</wheel>

August 29th, 2008 Posted by | xml | no comments

No Comments

No comments yet.

Sorry, the comment form is closed at this time.