XPath grammar

The table defines the subset of the XPath 2.0 expressions supported in the DCI pipeline. The links in the first column are to the normative EBNF production in XML Path (XPath) Language 2.0. The comments highlight difference where the pipeline subset differs from XPath 2.0. The production sequence numbers from the XPath recommendation are also given, when they are different.

The table defines the subset of the XPath 2.0 expressions supported in the DCI pipeline. The links in the first column are to the normative EBNF production in XML Path (XPath) Language 2.0. The comments highlight difference where the pipeline subset differs from XPath 2.0. The production sequence numbers from the XPath recommendation are also given, when they are different.

XPath
Value: Expr
Expr
Value: ExprSingle Comma separated sequence of expressions are not supported.
ExprSingle
Value: OrExpr for, quantified and if expressions are not supported.
OrExpr
Value: AndExpr ("or" AndExpr)*[8]
AndExpr
Value: ComparisonExpr ("and" ComparisonExpr)* [9]
ComparisonExpr
Value: AdditiveExpr ( (ValueComp | GeneralComp) AdditiveExpr)?Range expressions and node comparisons are not supported. [10]
AdditiveExpr
Value: MultiplicativeExpr ( ("+" | "-") MultiplicativeExpr [12]
MultiplicativeExpr
Value: UnionExpr ( ("*" | "div" | "idiv" | "mod") UnionExpr )*Instance of, treat as, castable as, and cast expressions are not supported. [13]
UnionExpr
Value: IntersectExceptExpr ( ("union" | "|") IntersectExceptExpr )*[14]
IntersectExceptExpr
Value: UnaryExpr ( ("intersect" | "except") UnaryExpr )* [15]
UnaryExpr
Value: ("-" | "+")* ValueExpr [20]
ValueExpr
Value: PathExpr [21]
GeneralComp
Value: "=" | "!=" | "<" | "<=" | ">" | ">=" [22]
ValueComp
Value: "eq" | "ne" | "lt" | "le" | "gt" | "ge" [23]
PathExpr
Value: RelativePathExpr Document relative paths, that is those starting with '/', are not supported. [25]
RelativePathExpr
Value: StepExpr (("/" | "//") StepExpr)* [26]
StepExpr
Value: FilterExpr | AxisStep
AxisStep
Value: ForwardStep PredicateList Reverse steps (parent, ancestor, preceding-sibling, preceding and ancestor-or-self axes) are not supported. [27]
ForwardStep
Value: (ForwardAxis NodeTest) | AbbrevForwardStep [29]
ForwardAxis
Value: ("child" "::")| ("descendant" "::")|| ("attribute" "::")| ("self" "::")| ("descendant-or-self" "::")following-sibling, following and namespace axes are not supported. Namespace axis is deprecated in XPath 2.0 anyway. [30]
AbbrevForwardStep
Value: "@"? NodeTest [31]
NodeTest
Value: KindTest | NameTest [35]
NameTest
Value: QName | Wildcard [36]
Wildcard
Value: "*"| (NCName ":" "*")| ("*" ":" NCName)ws: explicit. [37]
FilterExpr
Value: PrimaryExpr PredicateList [38]
PredicateList
Value: Predicate* [39]
Predicate
Value: "[" Expr "]" [40]
PrimaryExpr
Value: Literal | VarRef | ParenthesizedExpr | ContextItemExpr | FunctionCall [41]
Literal
Value: NumericLiteral | StringLiteral [42]
NumericLiteral
Value: IntegerLiteral | DecimalLiteral | DoubleLiteral [43]
VarRef
Value: "$" VarName [44]
VarName
Value: QName [45]
ParenthesizedExpr
Value: "(" Expr? ")" [46]
ContextItemExpr
Value: "."
FunctionCall
Value: QName "(" (ExprSingle ("," ExprSingle)*)? ")" [47]
KindTest
Value: TextTest Only the text() node test is supported, all the rest (document(), element(), attribute(), schema-element(), schema-attribute(), processing-instruction(), comment() and node()) are not supported. [54]
TextTest
Value: "text" "(" ")" [57]
IntegerLiteral
Value: Digits
DecimalLiteral
Value: ("." Digits) | (Digits "." [0-9]*) [71]
DoubleLiteral
Value: (("." Digits) | (Digits ("." [0-9]*)?)) [eE] [+-]? Digits [73]
StringLiteral
Value: ('"' (EscapeQuot | [^"])* '"') | ("'" (EscapeApos | [^'])* "'") [74]
EscapeQuot
Value: '""' [75]
EscapeApos
Value: "''" [77]
QName
Value: [78]
NCName
Value: [79]
Char
Value: [80]
Digits
Value: [0-9]+ [81]

Related topics