XPath Tester

Test and evaluate XPath expressions against XML documents

Enter an XPath expression and click Evaluate
XPath Syntax Reference
/ Root or child separator
// Descendant or self
. Current node
.. Parent node
@ Attribute selector
* Wildcard (any element)
[n] Index (1-based)
[@attr] Has attribute
[@attr='v'] Attribute equals
text() Text nodes

Functions
count() Count nodes
string() Convert to string
contains() String contains
starts-with() String prefix
normalize-space() Trim whitespace

Common Examples