Is there a way to query an XML document to return the maximum of a given attribute using Xpath 1.0 ?
For example is there a way to get the max id ?
&
XPath 1.0
/library/book[not(@id < /library/book/@id)]
This query style is more generic and works even if books are grouped i.e.
Same query still works (the path should be modified)
/library/genre/book[not(@id < /library/genre/book/@id)]
or even
//book[not(@id < //book/@id)]
To avoid performance troubles use XPath 2 max()
instead