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.
ProtectedpeekProtectedpeekProtectedpreviousProtectedisProtectedadvanceProtectedcheckProtectedcheckProtectedmatchProtectedconsumeProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseProtectedparseParse 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.
ProtectedisOverride isStepStart to exclude function references. In XPath 3.0, name#arity is a function reference, not a location step.
ProtectedparseParse a string template from its lexeme and create a StringTemplateExpression. The template string contains the raw content between backticks.
ProtectedparseOverride parsePrimaryExpr to handle:
ProtectedparseOverride parseFilterExpr to handle lookup operators after predicates. Lookup operators have lower precedence than predicates.
ProtectedparseOverride parseSequenceType to support union types (XPath 3.1 Extension) Syntax: type1 | type2 | ... | typeN
Examples: xs:string | xs:integer (xs:integer | xs:decimal) | xs:double
ProtectedparseOverride parseSequenceTypeInternal to support union types in type annotations This is called from instance of, treat as, cast as, etc.
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 ']'