.net - XPath to get the element with the highest ID -


xml source:

<documents>     <document>         <id>3</id>     </document>     <document>         <id>7</id>     </document>     <document>         <id>1</id>     </document> </documents> 

i need document-element highest value in id-element (so <document><id>7</id></document> in example). can't change c# code, xmldocument.selectsinglenode(...), can modify xpath used.

is there documents/document[id=max(id)] or order id descending it?

documents/document[not(../document/id > id)] 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -