Probador de XPath
Pega XML y una expresión XPath para inspeccionar los nodos, cadenas, números o resultados booleanos seleccionados, sin subir el documento.
Resultados
0 node(s)/value(s).
How to test XPath expressions
Paste XML and an XPath expression to inspect selected nodes, text values, numbers, or booleans.
What it evaluates
The tester uses the browser XPath engine when available. It can return node sets, strings, numbers, and booleans depending on the expression.
Reading node output
Node-set results are shown as trimmed text content or serialized XML for nodes without text. Long node lists are capped so the output stays readable.
Good XML inputs
- Use well-formed XML with one root element.
- Keep namespace-heavy documents simple when possible, since this first tester does not include namespace mapping controls.
- Check scalar expressions such as count(//item) when you only need a number.
Testing notes
XPath behavior can vary when a browser lacks XPath APIs or when XML relies heavily on namespaces. Confirm critical expressions in your production parser.
Preguntas frecuentes
Does it support XML namespaces?
There is no custom namespace resolver in this first version, so namespace-heavy XML may need simpler expressions or a dedicated XML tool.
Why does it say XPath needs a browser environment?
The evaluator depends on DOMParser and document.evaluate. If those APIs are not available, the tool reports that limitation instead of throwing an error.
Can it return numbers or booleans?
Yes. Expressions such as count(//book) or boolean(//price) return scalar values instead of node lists.
Why is my XML invalid?
The XML parser rejects malformed documents, such as missing closing tags, multiple root elements, or broken entity references.
