XPath Tester

Test XPath expressions against XML/HTML documents in real-time

Quick Examples:

Results

0 matches

XPath Quick Reference

Basic Selectors

  • //tag - All elements with tag
  • /tag - Root element with tag
  • . - Current node
  • .. - Parent node

Attributes

  • @attr - Select attribute
  • [@attr='value'] - By attribute value
  • [@attr] - Has attribute

Functions

  • text() - Text content
  • contains() - Contains text
  • position() - Element position
  • count() - Count elements

Axes

  • child:: - Child nodes
  • parent:: - Parent node
  • following:: - Following nodes
  • preceding:: - Preceding nodes