Skip to main content

Module parser

Module parser 

Source
Expand description

XPath expression parser — parses strings into XPathExpr nodes. XPath expression parser.

Parses a subset of XPath 1.0 into XPathExpr AST nodes.

§Supported syntax

  • //tag — descendant search
  • //tag[@attr='value'] — attribute predicate
  • //tag[contains(@attr, 'substr')] — contains predicate
  • //tag[position()=N] — position predicate
  • //tag/text() — text extraction
  • /path/to/tag — absolute path
  • //* — descendant wildcard
  • .. — parent axis

Functions§

parse_xpath
Parse an XPath expression string into an AST.