Data Format Description Language (DFDL) v1.0 Specification
OGF Proposed Recommendation GFD-P-R.174, January 31, 2011


23.4 DFDL Expression Syntax

Refer to XML Path Language (XPath) 2.0 [XPath2 for a description of XPath expressions
DFDL Expression

   ::=   

"{" Expr "}"
Expr

   ::=   

ExprSingle
ExprSingle

   ::=   

IfExpr| OrExpr
IfExpr

   ::=   

"if" "(" Expr ")" "then" ExprSingle "else" ExprSingle
OrExpr

   ::=   

AndExpr ( "or" AndExpr )*
AndExpr

   ::=   

ComparisonExpr ( "and" ComparisonExpr )*
ComparisonExpr

   ::=   

AdditiveExpr ( (ValueComp) AdditiveExpr)?

   
AdditiveExpr

   ::=   

MultiplicativeExpr ( ("+" | "-") MultiplicativeExpr )*
MultiplicativeExpr

   ::=   

UnaryExpr ( ("*" | "div" | "idiv" | "mod") UnaryExpr )*
UnaryExpr

   ::=   

("-" | "+")* ValueExpr
ValueExpr

   ::=   

PathExpr
ValueComp

   ::=   

"eq" | "ne" | "lt" | "le" | "gt" | "ge"
PathExpr

   ::=   

("/" RelativePathExpr?)| RelativePathExpr
RelativePathExpr

   ::=   

StepExpr (("/") StepExpr)*
StepExpr

   ::=   

FilterExpr | AxisStep
AxisStep

   ::=   

(ReverseStep | ForwardStep) Predicate
ForwardStep

   ::=   

(ForwardAxis NodeTest) | AbbrevForwardStep
ForwardAxis

   ::=   

("child" "::")| ("self" "::")
AbbrevForwardStep

   ::=   

NodeTest
ReverseStep

   ::=   

(ReverseAxis NodeTest) | AbbrevReverseStep
ReverseAxis

   ::=   

("parent" "::")")
AbbrevReverseStep

   ::=   

".."
NodeTest

   ::=   

NameTest
NameTest

   ::=   

QName
FilterExpr

   ::=   

PrimaryExpr Predicate
Predicate

   ::=   

"[" Expr "]"
PrimaryExpr

   ::=   

Literal | VarRef | ParenthesizedExpr | ContextItemExpr | FunctionCall
Literal

   ::=   

NumericLiteral | StringLiteral
NumericLiteral

   ::=   

IntegerLiteral | DecimalLiteral | DoubleLiteral
VarRef

   ::=   

"$" VarName
VarName

   ::=   

QName
ParenthesizedExpr

   ::=   

"(" Expr? ")"
ContextItemExpr

   ::=   

"."
FunctionCall

   ::=   

QName "(" (ExprSingle ("," ExprSingle)*)? ")"
Table 26 DFDL Expression Language

 

Notes:

  1. Only If and path expression types are supported

  2. Only the child, parent, and self axes are supported

  3. Predicates are only used to index arrays and so must be integer expressions otherwise a schema definition error occurs

  4. A subset of the XPath 2.0 operators are supported


Copyright (C) Open Grid Forum (2005-2010). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OGF or other organizations, except as needed for the purpose of developing Grid Recommendations in which case the procedures for copyrights defined in the OGF Document process must be followed, or as required to translate it into languages other than English.