Test an XPath against real XML

Before the scraper ships, check that //item[price>100] really selects what you think — on your own document.

Tools used in this guide

The job

XPath looks simple until namespaces, attributes, and nested structure bend it. A live tester shows the exact node set an expression hits in your document instead of in your head.

Document and expression

Paste XML on the left and an XPath 1.0 expression — the browser's own DOMParser and document.evaluate run it, so the semantics match what browsers and many libraries produce.

Worked example

Against <catalog><item><price>150</price></item><item><price>20</price></item></catalog>, the expression //item[price>100]/price returns one element node containing 150. count(//item) returns the scalar 2 instead of a node list.

Scope

XPath 1.0 on parsed XML — documents up to 2M characters, expressions up to 2,000, and at most 500 matched nodes listed. Namespace-aware queries, XPath 2.0+ functions, and HTML documents are not supported.