Paste XML on the left, type an XPath expression here, and view results on the right. Output updates automatically as you type.
The XML must be well-formed. If parsing fails, an error will appear in the Evaluation Results panel.
No result. Try a different XPath expression.
This XPath Evaluator lets you test and debug XPath expressions against XML documents directly in your browser. Results are evaluated automatically to give immediate feedback.
Basic Steps
Importing XML Files
.xml file.Output Paths Toggle
When to Use XPath
Basic Syntax
/store/book — select all <book> children of <store>//book — select all <book> elements anywhere in the document/store/book/title — select all <title> children of <book>//title/text() — select the text content of all <title> elementsPredicates & Filtering
//book[price < 20] — books cheaper than 20//book[author = "Lena Matthews"] — books by a specific author//book[position() = 1] — the first <book> elementUseful Axes
child::book — explicit child axis (equivalent to book)parent::* — parent of the current nodeancestor::store — ancestor <store> nodesOfficial References