In XPath 2.0, use the max
function. To find the book with the highest id
, do
/library/book[@id = max(/library/book/@id)]
More Related Contents:
- How to pass variable parameter into XPath expression?
- How can I use XPath to find the minimum value of an attribute in a set of elements?
- How does XPath deal with XML namespaces?
- How to parse XML in Bash?
- Is there a way to learn xpath without using firebug or xpath as firefox is not supporting the addons?
- Current node vs. Context node in XSLT/XPath?
- XPath to select element based on childs child value
- XPath select all elements between two specific elements
- XPath – Difference between node() and text()
- How to use XPath contains() here?
- Using XPATH to search text containing
- XPath select node with namespace
- How to read large xml file without loading it in memory and using XElement
- Extract value of attribute node via XPath
- How to declare XPath namespaces in xmlstarlet?
- How do you output the current element path in XSLT?
- Encoding XPath Expressions with both single and double quotes
- What is the XPath to select a range of nodes?
- Navigating XML nodes in VBScript, for a Dummy
- What is the difference between // and .// in XPath?
- If double slash (//) is used 2 times in XPath, what does it mean?
- xmllint failing to properly query with xpath without namespaces
- How to retrieve namespaces in XML files using Xpath
- Concatenate multiple node values in xpath
- Difference between “//” and “/” in XPath?
- How to insert a new element under another with xmlstarlet?
- XPath find all elements with specific child node
- How do I generate a comma-separated list with XSLT/XPath?
- Matching a node based on a sibling’s value with XPath
- XSLT – Comparing preceding-sibling’s elements with current’s node element