WSDL Analyzer

XPath Tester: Evaluate XPath Expressions Online

An XPath tester evaluates an XPath expression against an XML document and shows exactly which nodes match. Paste your XML, type an expression like //book[price>10]/title, and every matching node is listed instantly, including scalar results from functions like count() and string(). The document's namespaces are detected automatically, with a working prefix offered for the default namespace (the number one cause of "XPath matches nothing").

XPath 1.0 (browser engine)

How it works

  1. 1

    Paste your XML document.

  2. 2

    Type an XPath expression (press Enter or click Evaluate).

  3. 3

    Inspect the matched nodes, or the number/string/boolean result for function expressions.

Frequently asked questions

How do I test an XPath expression online?

Paste the XML above, enter the expression, and click Evaluate. Node-set results are listed as serialized XML fragments; expressions like count(//item) or boolean(//error) return their scalar value directly.

Why does my XPath return no results when the element clearly exists?

Almost always namespaces. If the document declares a default namespace (xmlns="..."), unprefixed names in XPath 1.0 match nothing. Use the d: prefix this tool maps to the default namespace (//d:book), or the namespace-agnostic form //*[local-name()='book'].

What XPath version does this tool support?

XPath 1.0, evaluated by the browser's native engine. This is the same version used by most XML tooling, XSLT 1.0, and libraries like lxml's default evaluator. XPath 2.0+ features (regex matching, for expressions, date functions) are not available in browsers.

How do I select attributes with XPath?

Prefix the attribute name with @: //book/@category selects the attribute nodes themselves, and //book[@category='fiction'] uses the attribute as a filter predicate.

Can I use XPath functions like count() and contains()?

Yes. All XPath 1.0 functions work: count(//book), sum(//price), contains(title, 'XML'), starts-with(), normalize-space(), position(), last(), and the rest.

Related tools