Optionaloptions: XPathBaseParserOptionsProtectedtokensProtectedcurrentProtected OptionalextensionsProtectedoptionsProtectedstaticProtectedwarningGet the warning collector for this parser. Useful for retrieving warnings after parsing.
ProtectedensureEnforce the supported XPath versions for a concrete parser.
Get the parser options.
ProtectedpeekProtectedpeekProtectedpreviousProtectedisProtectedadvanceProtectedcheckProtectedcheckProtectedmatchProtectedconsumeProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseParse range expression (to). Syntax: expr to expr Returns a sequence of consecutive integers from start to end.
ProtectedparseOverride parseExpr to handle:
ProtectedparseParse a single expression (not comma-separated).
ProtectedparseOverride parseAdditiveExpr to insert string concatenation (||) parsing. Precedence: || is between comparison and additive
ProtectedparseOverride parseUnionExpr to insert simple map operator (!) parsing. Precedence: ! is just above union (|)
ProtectedparseOverride parseFunctionCall to use parseExprSingle for arguments.
In XPath 3.0, function arguments are ExprSingle, not Expr. This means commas in arguments don't create sequences at the function level. For example: concat("Hello ", $name) should parse as two arguments, not one argument that is a sequence of two items.
ProtectedparseOverride parsePrimaryExpr to handle:
Hello {$name}!)ProtectedisOverride isStepStart to exclude function references. In XPath 3.0, name#arity is a function reference, not a location step.
ProtectedparseOverride parseFilterExpr to handle dynamic function calls. In XPath 3.0, any primary expression followed by '(' is a dynamic function call. Syntax: $func(args), (inline-function)(args), etc.
ProtectedparseParse sequence type for type annotations.
ProtectedparseParse a string template from its lexeme and create a StringTemplateExpression. The template string contains the raw content between backticks.
Recursive descent parser shared by XPath 1.0+ implementations.
Grammar (simplified): Expr ::= OrExpr OrExpr ::= AndExpr ('or' AndExpr)* AndExpr ::= EqualityExpr ('and' EqualityExpr)* EqualityExpr ::= RelationalExpr (('=' | '!=') RelationalExpr)* RelationalExpr ::= AdditiveExpr (('<' | '>' | '<=' | '>=') AdditiveExpr)* AdditiveExpr ::= MultiplicativeExpr (('+' | '-') MultiplicativeExpr)* MultiplicativeExpr ::= UnaryExpr (('' | 'div' | 'mod') UnaryExpr) UnaryExpr ::= '-'* UnionExpr UnionExpr ::= PathExpr ('|' PathExpr)* PathExpr ::= LocationPath | FilterExpr (('/' | '//') RelativeLocationPath)? FilterExpr ::= PrimaryExpr Predicate* PrimaryExpr ::= VariableReference | '(' Expr ')' | Literal | Number | FunctionCall LocationPath ::= RelativeLocationPath | AbsoluteLocationPath Step ::= AxisSpecifier NodeTest Predicate* | AbbreviatedStep Predicate ::= '[' Expr ']'