XPath Tester & Query Evaluator
Test and evaluate XPath expressions against XML documents online. Extract nodes, attributes, and text values with real-time XPath debugging.
How XPath Tester Works
- Parses XML document using native browser DOMParser.
- Evaluates XPath expressions using document.evaluate / XPathEvaluator.
- Displays matching node elements, attributes, and text values.
Example Input & Output
Evaluates the XPath expression //book[price > 35]/title/text() to select titles of books priced over 35.
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<price>30.00</price>
</book>
<book category="web">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<price>39.95</price>
</book>
</bookstore>Learning XML
Common Use Cases
Web Scraping Query Debugging
Test XPath selectors for Scrapy, Selenium, or Puppeteer automation.
XML Data Extraction
Extract targeted values from large XML feeds without writing scripts.
Key Specifications & Gotchas
Predicate Syntax Errors
Missing closing brackets in predicate expressions (e.g. //book[@id="1") will cause query failures.
Frequently Asked Questions
What is XPath?
XPath (XML Path Language) is a standard syntax for selecting nodes and values from XML documents.
Can I extract attribute values with XPath?
Yes! Use the @ symbol, such as //book/@category or //title/@lang.
Related XML & Data Format Tools
View all 41 tools →XML Formatter
Format and beautify XML code online. Indent XML tags, align attributes, fix malformed tags, and pretty print XML documents in your browser.
XML Validator
Validate XML syntax and well-formedness online. Detect unclosed tags, attribute syntax mistakes, and XML parsing errors with exact line numbers.
JSONPath Tester
Test and evaluate JSONPath expressions against JSON documents online. Extract data, query arrays, and debug JSONPath queries in real time.