Node-level inspection
See every matching node with its name, value, node type, and serialized XML.
Start typing to search 227 tools.
Evaluate XPath 1.0 expressions against XML and inspect matched nodes or typed string, number, and boolean results.
XPath Tester evaluates an XPath 1.0 expression against XML. Location paths return a node list with each node name, type, string value, and serialized XML. Functions such as count(), string(), and boolean() return a typed scalar result instead.
The server uses PHP DOMXPath, so the supported language is XPath 1.0 rather than XPath 2.0 or 3.1. Namespace declarations on the document element are registered automatically. A default XML namespace is available through the synthetic prefix default, because unprefixed XPath names match elements in no namespace.
//default:item.Focused controls, predictable output, and a workflow designed around this exact transformation.
See every matching node with its name, value, node type, and serialized XML.
Evaluate count, string, and boolean expressions instead of forcing every result into a node list.
Use declared prefixes and a documented default prefix for namespaced XML.
External network access is disabled while the test document is parsed.
Practical details about input, output, privacy, limits, and the best way to use this tool.
It uses PHP DOMXPath and supports XPath 1.0 expressions. XPath 2.0 and 3.x-only functions are not available.
Yes. Expressions such as count(//item) and boolean(//item) return typed scalar results.
In XPath 1.0, an unprefixed element test matches no namespace. Use the synthetic default prefix registered by this tool.
Yes. Use expressions such as //user/@id or //message/text(). Node results include their values and serialization.
The XML and expression can both be valid while no nodes satisfy the location path. Check names, case, predicates, hierarchy, and namespaces.
Network access is disabled for XML parsing. The tool evaluates only the supplied document and does not fetch linked resources.
No. The tester does not bind application variables or register custom PHP functions.
Your destination may use a different XPath version, namespace bindings, parser flags, document context, or extension functions.
A predicate filters product elements before the child name is selected.
XML: AlphaBeta XPath: //product[@status="active"]/name
result_type: nodes\ncount: 1\nmatch name: name\nmatch value: Alpha
DOMXPath evaluate returns a typed number for count instead of a node list.
XML: XPath: count(//product)
result_type: number\nvalue: 3
The string function returns the attribute value as a scalar.
XML: Ada XPath: string(/users/user/@id)
result_type: string\nvalue: 42
The tool registers the root default namespace under the prefix default.
XML: Ready XPath: //default:item
result_type: nodes\ncount: 1\nmatch value: Ready
A location path selects nodes from the XML tree. /catalog/product follows an absolute child path, while //product selects matching descendants. Predicates narrow a node set: //product[@status="active"] checks an attribute and //product[price > 20] compares a child value.
Positions are one-based. //product[1] does not mean array index zero; its exact scope also depends on the location step. Test positional expressions against repeated groups rather than assuming JavaScript-style indexing.
XPath 1.0 expressions return one of four core types: node set, string, number, or boolean. This tester preserves that distinction. Use string() when you want one text value, count() for a number, and boolean() for an existence check.
Values such as XPath NaN or Infinity cannot be represented as native JSON numbers, so they are returned as named strings while the result type remains number.
XPath matches expanded names, not only the visible tag text. Prefixes declared on the document element are registered for the expression. When the XML uses a default namespace, use default: in the test expression. Declarations introduced only on deeper elements may require a different test document or explicit bindings in the destination application.
The tool does not provide XPath 2.0 sequences, regular-expression functions, date types, maps, arrays, XQuery, XSLT, custom variables, or extension functions. Large result sets are serialized into the response, so narrow production-sized documents with a predicate when possible.
Check malformed XML first with XML Validator. Then verify the final expression in the exact library and runtime that will execute it.
Review the W3C XPath 1.0 Recommendation and the PHP DOMXPath evaluate documentation.