How to use XML XPath Query Tester
- Paste XML or choose one UTF-8 XML file to replace the text. Do not include a DTD or custom entity declaration.
- Enter an XPath 1.0 expression. For namespaced elements, map a prefix to the namespace URI in Namespace prefixes JSON and use it in the expression.
- Read the matched serialized values and namespace-aware node paths, or the scalar result from count(), string() or boolean(). Copy the output you need; the original XML is unchanged.
Example: XML XPath Query Tester
Select Lantern from the namespaced item whose price is greater than 20.
Options
- Namespace prefixes
- XPath 1.0 does not apply the XML default namespace to unprefixed element names. Map it explicitly, for example c to urn:example:catalog, and use c:item in the query. The xml prefix retains its standard namespace.
- Result type
- Node selections produce matched values and stable namespace-aware paths. Native scalar expressions such as count(), string() and boolean() produce a number, string or boolean instead. This page evaluates XPath 1.0, not XPath 2.0 or 3.1.
- Input and output bounds
- A selected UTF-8 XML file replaces pasted text and has a 1,000,000-byte cap; pasted XML accepts up to 1 MiB. A selection exceeding the result or output limit is refused instead of returned as a partial match list.
Supported inputs and limits
- Pasted XML up to 1 MiB, 5,000 total nodes including attributes and 64 levels.
- A chosen UTF-8 XML file is limited to 1,000,000 bytes.
- Expressions accept 500 UTF-8 bytes; namespace JSON accepts 12,000 bytes and 20 mappings, with prefixes up to 40 characters and namespace URIs up to 512.
- Selections accept at most 1,000 matches and 500,000 UTF-8 bytes including paths.
- DTDs and custom entities are refused.
More details
Diagnostic parsererror elements in Mozilla/XHTML namespaces, or a root named parsererror, are conservatively refused.
Browser XML/XPath support is required.
No URL fetch, XML rewriting, schema validation or generated result-file download occurs.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
No matches can be a namespace problem
Check the root namespace and the prefix map before changing a query that unexpectedly returns nothing. A successful query selects information from the supplied document; it does not validate the document against a schema. DTDs and custom entities are refused, no external documents are fetched, and copying the result leaves the original XML unchanged.
Questions about XML XPath Query Tester
Why does an unprefixed path miss namespaced elements?
XPath 1.0 does not use the XML default namespace for unprefixed element names. Add a prefix mapping and use that prefix in the expression.
Can it evaluate count() or boolean()?
Yes. Native scalar expressions return a number, string or boolean rather than a node list.
Does it load external entities?
No. Inputs declaring a DTD or custom entity are refused; the tool never fetches XML from a URL.