.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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -