START |
::= |
QueryList <EOF> |
QueryList |
::= |
Module ( "%%%" ( Module )? )* |
Module |
::= |
( VersionDecl )? ( LibraryModule | MainModule ) |
VersionDecl |
::= |
"xquery" ( ( "encoding" <StringLiteral> ) | ( "version" <StringLiteral> ( "encoding" <StringLiteral> )? ) ) Separator |
MainModule |
::= |
Prolog QueryBody |
LibraryModule |
::= |
ModuleDecl Prolog |
ModuleDecl |
::= |
"module" "namespace" NCName "=" URILiteral Separator |
Prolog |
::= |
( ( DefaultNamespaceDecl | Setter | NamespaceDecl | Import ) Separator )* ( ( ContextItemDecl | AnnotatedDecl | OptionDecl ) Separator )* |
Separator |
::= |
";" |
Setter |
::= |
( BoundarySpaceDecl | DefaultCollationDecl | BaseURIDecl | ConstructionDecl | OrderingModeDecl | EmptyOrderDecl | RevalidationDecl | CopyNamespacesDecl | DecimalFormatDecl ) |
BoundarySpaceDecl |
::= |
"declare" "boundary-space" ( "preserve" | "strip" ) |
DefaultCollationDecl |
::= |
"declare" "default" "collation" URILiteral |
BaseURIDecl |
::= |
"declare" "base-uri" URILiteral |
ConstructionDecl |
::= |
"declare" "construction" ( "strip" | "preserve" ) |
OrderingModeDecl |
::= |
"declare" "ordering" ( "ordered" | "unordered" ) |
EmptyOrderDecl |
::= |
"declare" "default" "order" "empty" ( <Greatest> | <Least> ) |
CopyNamespacesDecl |
::= |
"declare" "copy-namespaces" PreserveMode "," InheritMode |
PreserveMode |
::= |
( "preserve" | "no-preserve" ) |
InheritMode |
::= |
( "inherit" | "no-inherit" ) |
DecimalFormatDecl |
::= |
"declare" ( ( "decimal-format" EQName ) | ( "default" "decimal-format" ) ) ( DFPropertyName "=" <StringLiteral> )* |
DFPropertyName |
::= |
( "decimal-separator" | "grouping-separator" | "infinity" | "minus-sign" | "NaN" | "percent" | "per-mille" | "zero-digit" | "digit" | "pattern-separator" ) |
Import |
::= |
( SchemaImport | ModuleImport ) |
SchemaImport |
::= |
"import" "schema" ( SchemaPrefix )? URILiteral ( "at" URILiteral ( "," URILiteral )* )? |
SchemaPrefix |
::= |
( ( "namespace" NCName "=" ) | ( "default" "element" "namespace" ) ) |
ModuleImport |
::= |
"import" "module" ( "namespace" NCName "=" )? URILiteral ( "at" URILiteral ( "," URILiteral )* )? |
NamespaceDecl |
::= |
"declare" "namespace" NCName "=" URILiteral |
DefaultNamespaceDecl |
::= |
"declare" "default" ( "element" | "function" ) "namespace" URILiteral |
AnnotatedDecl |
::= |
"declare" ( ( CompatibilityAnnotation | Annotation ) )* ( VarDecl | FunctionDecl ) |
CompatibilityAnnotation |
::= |
"updating" |
Annotation |
::= |
"%" EQName ( "(" Literal ( "," Literal )* ")" )? |
VarDecl |
::= |
"variable" "$" VarName ( TypeDeclaration )? ( ( ":=" VarValue ) | ( <External> ( ":=" VarDefaultValue )? ) ) |
VarValue |
::= |
ExprSingle |
VarDefaultValue |
::= |
ExprSingle |
ContextItemDecl |
::= |
"declare" "context" "item" ( "as" ItemType )? ( ( ":=" VarValue ) | ( <External> ( ":=" VarDefaultValue )? ) ) |
FunctionDecl |
::= |
"function" FunctionEQName "(" ( ParamList )? ")" ( "as" SequenceType )? ( FunctionBody | <External> ) |
ParamList |
::= |
Param ( "," Param )* |
Param |
::= |
"$" EQName ( TypeDeclaration )? |
FunctionBody |
::= |
Block |
EnclosedExpr |
::= |
<Lbrace> Expr <Rbrace> |
OptionDecl |
::= |
"declare" "option" EQName <StringLiteral> |
QueryBody |
::= |
Expr |
Expr |
::= |
ApplyExpr |
ApplyExpr |
::= |
ConcatExpr ( ";" ( ConcatExpr ";" )* )? |
ConcatExpr |
::= |
ExprSingle ( "," ExprSingle )* |
ExprSingle |
::= |
( FLWORExpr11 | QuantifiedExpr | SwitchExpr | TypeswitchExpr | IfExpr | TryCatchExpr | InsertExpr | DeleteExpr | RenameExpr | ReplaceExpr | TransformExpr | BlockExpr | AssignmentExpr | ExitExpr | WhileExpr | OrExpr ) |
FLWORExpr11 |
::= |
InitialClause ( IntermediateClause )* ReturnClause |
InitialClause |
::= |
( ForClause | LetClause | WindowClause ) |
IntermediateClause |
::= |
( InitialClause | WhereClause | GroupByClause | OrderByClause | CountClause ) |
ForClause |
::= |
"for" ForBinding ( "," ForBinding )* |
ForBinding |
::= |
"$" VarName ( TypeDeclaration )? ( AllowingEmpty )? ( PositionalVar )? "in" ExprSingle |
AllowingEmpty |
::= |
"allowing" "empty" |
PositionalVar |
::= |
"at" "$" VarName |
LetClause |
::= |
"let" LetBinding ( "," LetBinding )* |
LetBinding |
::= |
( "$" VarName ( TypeDeclaration )? ) ":=" ExprSingle |
WindowClause |
::= |
"for" ( TumblingWindowClause | SlidingWindowClause ) |
TumblingWindowClause |
::= |
"tumbling" "window" "$" VarName ( TypeDeclaration )? "in" ExprSingle WindowStartCondition ( WindowEndCondition )? |
SlidingWindowClause |
::= |
"sliding" "window" "$" VarName ( TypeDeclaration )? "in" ExprSingle WindowStartCondition WindowEndCondition |
WindowStartCondition |
::= |
"start" WindowVars "when" ExprSingle |
WindowEndCondition |
::= |
( "only" )? "end" WindowVars "when" ExprSingle |
WindowVars |
::= |
( "$" CurrentItem )? ( PositionalVar )? ( "previous" "$" PreviousItem )? ( "next" "$" NextItem )? |
CurrentItem |
::= |
EQName |
PreviousItem |
::= |
EQName |
NextItem |
::= |
EQName |
CountClause |
::= |
"count" "$" VarName |
WhereClause |
::= |
"where" ExprSingle |
GroupByClause |
::= |
"group" "by" GroupingSpecList |
GroupingSpecList |
::= |
GroupingSpec ( "," GroupingSpec )* |
GroupingSpec |
::= |
GroupingVariable ( ( TypeDeclaration )? ":=" ExprSingle )? ( "collation" URILiteral )? |
GroupingVariable |
::= |
"$" VarName |
OrderByClause |
::= |
( ( "order" "by" ) | ( "stable" "order" "by" ) ) OrderSpecList |
OrderSpecList |
::= |
OrderSpec ( "," OrderSpec )* |
OrderSpec |
::= |
ExprSingle OrderModifier |
OrderModifier |
::= |
( ( <Ascending> | <Descending> ) )? ( "empty" ( <Greatest> | <Least> ) )? ( "collation" URILiteral )? |
ReturnClause |
::= |
"return" ExprSingle |
QuantifiedExpr |
::= |
( "some" | "every" ) "$" VarName ( TypeDeclaration )? "in" ExprSingle ( "," "$" VarName ( TypeDeclaration )? "in" ExprSingle )* "satisfies" ExprSingle |
SwitchExpr |
::= |
"switch" "(" Expr ")" ( SwitchCaseClause )+ "default" "return" ExprSingle |
SwitchCaseClause |
::= |
( "case" SwitchCaseOperand )+ "return" ExprSingle |
SwitchCaseOperand |
::= |
ExprSingle |
TypeswitchExpr |
::= |
"typeswitch" "(" Expr ")" ( CaseClause )+ "default" ( "$" VarName )? "return" ExprSingle |
CaseClause |
::= |
"case" ( "$" VarName "as" )? SequenceTypeUnion "return" ExprSingle |
SequenceTypeUnion |
::= |
SequenceType ( "|" SequenceType )* |
IfExpr |
::= |
"if" "(" Expr ")" "then" ExprSingle "else" ExprSingle |
TryCatchExpr |
::= |
TryClause ( CatchClause )+ |
TryClause |
::= |
"try" <Lbrace> TryTargetExpr <Rbrace> |
TryTargetExpr |
::= |
Expr |
CatchClause |
::= |
"catch" CatchErrorList <Lbrace> Expr <Rbrace> |
CatchErrorList |
::= |
NameTest ( "|" NameTest )* |
OperatorExpr |
::= |
OrExpr |
OrExpr |
::= |
AndExpr ( "or" AndExpr )* |
AndExpr |
::= |
ComparisonExpr ( "and" ComparisonExpr )* |
ComparisonExpr |
::= |
StringConcatExpr ( ( ValueComp | GeneralComp | NodeComp ) StringConcatExpr )? |
StringConcatExpr |
::= |
RangeExpr ( "||" RangeExpr )* |
RangeExpr |
::= |
AdditiveExpr ( "to" AdditiveExpr )? |
AdditiveExpr |
::= |
MultiplicativeExpr ( ( <Plus> | <Minus> ) MultiplicativeExpr )* |
MultiplicativeExpr |
::= |
UnionExpr ( ( "*" | "div" | "idiv" | "mod" ) UnionExpr )* |
UnionExpr |
::= |
IntersectExceptExpr ( ( "union" | "|" ) IntersectExceptExpr )* |
IntersectExceptExpr |
::= |
InstanceofExpr ( ( "intersect" | "except" ) InstanceofExpr )* |
InstanceofExpr |
::= |
TreatExpr ( ( "instance" "of" SequenceType ) )? |
TreatExpr |
::= |
CastableExpr ( ( "treat" "as" SequenceType ) )? |
CastableExpr |
::= |
CastExpr ( ( "castable" "as" SingleType ) )? |
CastExpr |
::= |
UnaryExpr ( ( "cast" "as" SingleType ) )? |
UnaryExpr |
::= |
( ( <Minus> | <Plus> ) )* ValueExpr |
ValueExpr |
::= |
( ValidateExpr | ExtensionExpr | SimpleMapExpr ) |
GeneralComp |
::= |
( "=" | "!=" | <LeftAngleBracket> | "<=" | ">" | ">=" ) |
ValueComp |
::= |
( "eq" | "ne" | "lt" | "le" | "gt" | "ge" ) |
NodeComp |
::= |
( "is" | "<<" | ">>" ) |
ValidateExpr |
::= |
"validate" ( ( ValidationMode | ( "type" TypeName ) ) )? <Lbrace> Expr <Rbrace> |
ValidationMode |
::= |
( "lax" | "strict" ) |
ExtensionExpr |
::= |
( Pragma )+ <Lbrace> ( Expr )? <Rbrace> |
Pragma |
::= |
<PragmaOpen> ( <S> )? EQName ( <S> PragmaContents )? <PragmaClose> |
PragmaContents |
::= |
( <Char> )* |
SimpleMapExpr |
::= |
PathExpr ( "!" PathExpr )* |
PathExpr |
::= |
( ( <Slash> ( RelativePathExpr )? ) | ( <SlashSlash> RelativePathExpr ) | RelativePathExpr ) |
RelativePathExpr |
::= |
StepExpr ( ( <Slash> | <SlashSlash> ) StepExpr )* |
StepExpr |
::= |
( PostfixExpr | AxisStep ) |
AxisStep |
::= |
( ReverseStep | ForwardStep ) PredicateList |
ForwardStep |
::= |
( ( ForwardAxis NodeTest ) | AbbrevForwardStep ) |
ForwardAxis |
::= |
( ( "child" "::" ) | ( "descendant" "::" ) | ( "attribute" "::" ) | ( "self" "::" ) | ( "descendant-or-self" "::" ) | ( "following-sibling" "::" ) | ( "following" "::" ) ) |
AbbrevForwardStep |
::= |
( "@" )? NodeTest |
ReverseStep |
::= |
( ( ReverseAxis NodeTest ) | AbbrevReverseStep ) |
ReverseAxis |
::= |
( ( "parent" "::" ) | ( "ancestor" "::" ) | ( "preceding-sibling" "::" ) | ( "preceding" "::" ) | ( "ancestor-or-self" "::" ) ) |
AbbrevReverseStep |
::= |
".." |
NodeTest |
::= |
( KindTest | NameTest ) |
NameTest |
::= |
( EQName | Wildcard ) |
Wildcard |
::= |
( "*" | <NCNameColonStar> | <StarColonNCName> | <URIQualifiedStar> ) |
PostfixExpr |
::= |
PrimaryExpr ( ( Predicate | ArgumentList ) )* |
ArgumentList |
::= |
"(" ( Argument ( "," Argument )* )? ")" |
PredicateList |
::= |
( Predicate )* |
Predicate |
::= |
"[" Expr "]" |
PrimaryExpr |
::= |
( Literal | VarRef | ParenthesizedExpr | ContextItemExpr | FunctionCall | OrderedExpr | UnorderedExpr | Constructor | FunctionItemExpr ) |
Literal |
::= |
( NumericLiteral | <StringLiteral> ) |
NumericLiteral |
::= |
( <IntegerLiteral> | <DecimalLiteral> | <DoubleLiteral> ) |
VarRef |
::= |
"$" VarName |
VarName |
::= |
EQName |
ParenthesizedExpr |
::= |
"(" ( Expr )? ")" |
ContextItemExpr |
::= |
"." |
OrderedExpr |
::= |
"ordered" <Lbrace> Expr <Rbrace> |
UnorderedExpr |
::= |
"unordered" <Lbrace> Expr <Rbrace> |
FunctionCall |
::= |
FunctionEQName ArgumentList |
Argument |
::= |
( ExprSingle | ArgumentPlaceholder ) |
ArgumentPlaceholder |
::= |
"?" |
Constructor |
::= |
( DirectConstructor | ComputedConstructor ) |
DirectConstructor |
::= |
( DirElemConstructor | DirCommentConstructor | DirPIConstructor ) |
DirElemConstructor |
::= |
<LeftAngleBracket> <TagQName> DirAttributeList ( <EmptyTagClose> | ( <StartTagClose> ( DirElemContent )* <EndTagOpen> <EndTagQName> ( <S> )? <EndTagClose> ) ) |
DirAttributeList |
::= |
( <S> ( <TagQName> ( <S> )? <ValueIndicator> ( <S> )? DirAttributeValue )? )* |
DirAttributeValue |
::= |
( ( <OpenQuot> ( ( <EscapeQuot> | QuotAttrValueContent ) )* <CloseQuot> ) | ( <OpenApos> ( ( <EscapeApos> | AposAttrValueContent ) )* <CloseApos> ) ) |
QuotAttrValueContent |
::= |
( <QuotAttrContentChar> | CommonContent ) |
AposAttrValueContent |
::= |
( <AposAttrContentChar> | CommonContent ) |
DirElemContent |
::= |
( DirectConstructor | CDataSection | CommonContent | <ElementContentChar> ) |
CommonContent |
::= |
( <PredefinedEntityRef> | <CharRef> | <LCurlyBraceEscape> | <RCurlyBraceEscape> | EnclosedExpr ) |
DirCommentConstructor |
::= |
<DirCommentStart> DirCommentContents <DirCommentEnd> |
DirCommentContents |
::= |
( ( <DirCommentContentChar> | <DirCommentContentDashChar> ) )* |
DirPIConstructor |
::= |
<ProcessingInstructionStart> <PITarget> ( <S> DirPIContents )? <ProcessingInstructionEnd> |
DirPIContents |
::= |
( <Char> )* |
CDataSection |
::= |
<CdataSectionStart> CDataSectionContents <CdataSectionEnd> |
CDataSectionContents |
::= |
( <Char> )* |
ComputedConstructor |
::= |
( CompDocConstructor | CompElemConstructor | CompAttrConstructor | CompNamespaceConstructor | CompTextConstructor | CompCommentConstructor | CompPIConstructor ) |
CompDocConstructor |
::= |
"document" <Lbrace> Expr <Rbrace> |
CompElemConstructor |
::= |
"element" ( EQName | ( <Lbrace> Expr <Rbrace> ) ) <Lbrace> ( ContentExpr )? <Rbrace> |
ContentExpr |
::= |
Expr |
CompAttrConstructor |
::= |
"attribute" ( EQName | ( <Lbrace> Expr <Rbrace> ) ) <Lbrace> ( Expr )? <Rbrace> |
CompNamespaceConstructor |
::= |
"namespace" ( Prefix | ( <Lbrace> PrefixExpr <Rbrace> ) ) <Lbrace> URIExpr <Rbrace> |
Prefix |
::= |
NCName |
PrefixExpr |
::= |
Expr |
URIExpr |
::= |
Expr |
CompTextConstructor |
::= |
"text" <Lbrace> Expr <Rbrace> |
CompCommentConstructor |
::= |
"comment" <Lbrace> Expr <Rbrace> |
CompPIConstructor |
::= |
"processing-instruction" ( NCName | ( <Lbrace> Expr <Rbrace> ) ) <Lbrace> ( Expr )? <Rbrace> |
FunctionItemExpr |
::= |
( NamedFunctionRef | InlineFunctionExpr ) |
NamedFunctionRef |
::= |
FunctionEQName "#" <IntegerLiteral> |
InlineFunctionExpr |
::= |
( Annotation )* "function" "(" ( ParamList )? ")" ( "as" SequenceType )? FunctionBody |
SingleType |
::= |
SimpleTypeName ( "?" )? |
TypeDeclaration |
::= |
"as" SequenceType |
SequenceType |
::= |
( ( "empty-sequence" "(" ")" ) | ( ItemType ( OccurrenceIndicator )? ) ) |
OccurrenceIndicator |
::= |
( "?" | "*" | <Plus> ) |
ItemType |
::= |
( KindTest | ( "item" "(" ")" ) | FunctionTest | AtomicOrUnionType | ParenthesizedItemType ) |
AtomicOrUnionType |
::= |
EQName |
KindTest |
::= |
( DocumentTest | ElementTest | AttributeTest | SchemaElementTest | SchemaAttributeTest | PITest | CommentTest | TextTest | NamespaceNodeTest | AnyKindTest ) |
AnyKindTest |
::= |
"node" "(" ")" |
DocumentTest |
::= |
"document-node" "(" ( ( ElementTest | SchemaElementTest ) )? ")" |
TextTest |
::= |
"text" "(" ")" |
CommentTest |
::= |
"comment" "(" ")" |
NamespaceNodeTest |
::= |
"namespace-node" "(" ")" |
PITest |
::= |
"processing-instruction" "(" ( ( NCName | <StringLiteral> ) )? ")" |
AttributeTest |
::= |
"attribute" "(" ( AttribNameOrWildcard ( "," TypeName )? )? ")" |
AttribNameOrWildcard |
::= |
( AttributeName | "*" ) |
SchemaAttributeTest |
::= |
"schema-attribute" "(" AttributeDeclaration ")" |
AttributeDeclaration |
::= |
AttributeName |
ElementTest |
::= |
"element" "(" ( ElementNameOrWildcard ( "," TypeName ( "?" )? )? )? ")" |
ElementNameOrWildcard |
::= |
( ElementName | "*" ) |
SchemaElementTest |
::= |
"schema-element" "(" ElementDeclaration ")" |
ElementDeclaration |
::= |
ElementName |
AttributeName |
::= |
EQName |
ElementName |
::= |
EQName |
SimpleTypeName |
::= |
TypeName |
TypeName |
::= |
EQName |
FunctionTest |
::= |
( Annotation )* ( AnyFunctionTest | TypedFunctionTest ) |
AnyFunctionTest |
::= |
"function" "(" "*" ")" |
TypedFunctionTest |
::= |
"function" "(" ( SequenceType ( "," SequenceType )* )? ")" "as" SequenceType |
ParenthesizedItemType |
::= |
"(" ItemType ")" |
URILiteral |
::= |
<StringLiteral> |
RevalidationDecl |
::= |
"declare" "revalidation" ( "strict" | "lax" | "skip" ) |
InsertExprTargetChoice |
::= |
( ( ( "as" ( "first" | "last" ) )? "into" ) | "after" | "before" ) |
InsertExpr |
::= |
"insert" ( "node" | "nodes" ) SourceExpr InsertExprTargetChoice TargetExpr |
DeleteExpr |
::= |
"delete" ( "node" | "nodes" ) TargetExpr |
ReplaceExpr |
::= |
"replace" ( "value" "of" )? "node" TargetExpr "with" ExprSingle |
RenameExpr |
::= |
"rename" "node" TargetExpr "as" NewNameExpr |
SourceExpr |
::= |
ExprSingle |
TargetExpr |
::= |
ExprSingle |
NewNameExpr |
::= |
ExprSingle |
TransformExpr |
::= |
"copy" "$" VarName ":=" ExprSingle ( "," "$" VarName ":=" ExprSingle )* "modify" ExprSingle "return" ExprSingle |
BlockExpr |
::= |
"block" Block |
Block |
::= |
<Lbrace> BlockDecls BlockBody <Rbrace> |
BlockDecls |
::= |
( BlockVarDecl ";" )* |
BlockVarDecl |
::= |
"declare" "$" VarName ( TypeDeclaration )? ( ":=" ExprSingle )? ( "," "$" VarName ( TypeDeclaration )? ( ":=" ExprSingle )? )* |
BlockBody |
::= |
Expr |
AssignmentExpr |
::= |
"$" VarName ":=" ExprSingle |
ExitExpr |
::= |
"exit" "returning" ExprSingle |
WhileExpr |
::= |
"while" "(" ExprSingle ")" WhileBody |
WhileBody |
::= |
Block |
EQName |
::= |
( QName | <URIQualifiedName> ) |
FunctionEQName |
::= |
( FunctionQName | <URIQualifiedName> ) |
NCName |
::= |
QName |
QName |
::= |
( FunctionQName | "attribute" | "comment" | "document-node" | "element" | "empty-sequence" | "function" | "if" | "item" | "namespace-node" | "node" | "processing-instruction" | "schema-attribute" | "schema-element" | "switch" | "text" | "typeswitch" | "while" ) |
FunctionQName |
::= |
( <QNameToken> | <Ascending> | <Descending> | <External> | <Greatest> | <Least> | "NaN" | "after" | "allowing" | "ancestor" | "ancestor-or-self" | "and" | "as" | "at" | "base-uri" | "before" | "block" | "boundary-space" | "by" | "case" | "cast" | "castable" | "catch" | "child" | "collation" | "construction" | "context" | "copy" | "copy-namespaces" | "count" | "decimal-format" | "decimal-separator" | "declare" | "default" | "delete" | "descendant" | "descendant-or-self" | "digit" | "div" | "document" | "else" | "empty" | "encoding" | "end" | "eq" | "every" | "except" | "exit" | "first" | "following" | "following-sibling" | "for" | "ge" | "group" | "grouping-separator" | "gt" | "idiv" | "import" | "in" | "infinity" | "inherit" | "insert" | "instance" | "intersect" | "into" | "is" | "last" | "lax" | "le" | "let" | "lt" | "minus-sign" | "mod" | "modify" | "module" | "namespace" | "ne" | "next" | "no-inherit" | "no-preserve" | "nodes" | "of" | "only" | "option" | "or" | "order" | "ordered" | "ordering" | "parent" | "pattern-separator" | "per-mille" | "percent" | "preceding" | "preceding-sibling" | "preserve" | "previous" | "rename" | "replace" | "return" | "returning" | "revalidation" | "satisfies" | "schema" | "self" | "skip" | "sliding" | "some" | "stable" | "start" | "strict" | "strip" | "then" | "to" | "treat" | "try" | "tumbling" | "type" | "union" | "unordered" | "updating" | "validate" | "value" | "variable" | "version" | "when" | "where" | "window" | "with" | "xquery" | "zero-digit" ) |