☀️
🌙

Paste XML on the left, type an XPath expression here, and view results on the right. Output updates automatically as you type.

XML Input, You can also import from

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

The XML must be well-formed. If parsing fails, an error will appear in the Evaluation Results panel.

Evaluation Results

Output Paths
No result. Try a different XPath expression.
How to Use the XPath Tool

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

  • Paste or import XML into the XML Input panel on the left.
  • Enter a valid XPath expression in the textbox above.
  • The tool evaluates your expression and shows the results on the right.
  • If the XML is invalid or the XPath is incorrect, you’ll see an error message.

Importing XML Files

  • Click the Import File button to load a local .xml file.
  • Once loaded, the editor updates and the current XPath is re-evaluated.

Output Paths Toggle

  • When Output Paths is OFF, the tool displays node values or XML snippets.
  • When it is ON, the tool displays the XPath-like location of each matched node, which is useful for debugging complex documents.

When to Use XPath

  • Working with XML-based APIs or configuration files.
  • Testing queries for XSLT, XQuery, or XML databases.
  • Debugging large XML datasets or legacy enterprise systems.
XPath Reference & Syntax

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> elements

Predicates & Filtering

  • //book[price < 20] — books cheaper than 20
  • //book[author = "Lena Matthews"] — books by a specific author
  • //book[position() = 1] — the first <book> element

Useful Axes

  • child::book — explicit child axis (equivalent to book)
  • parent::* — parent of the current node
  • ancestor::store — ancestor <store> nodes

Official References