XPathExpression.parse

XPathExpression parse(string expression) @safe

Parses an XPath expression.

Supported subset (MVP):

  • child steps: a/b
  • descendant-or-self: //b
  • self: `.`
  • parent: `..`
  • wildcard: `*`
  • node tests: node(), text()
  • attribute axis selection: @id (returns text nodes with the attribute value)
  • predicates: [n], [@attr], [@attr='value']

Parameters

expressionXPath expression.

Returns

Parsed XPathExpression.

Throws

XmlException on syntax errors.