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 )* ( ( VarDecl | ContextItemDecl | FunctionDecl | OptionDecl ) Separator )* |
Setter |
::= |
( BoundarySpaceDecl | DefaultCollationDecl | BaseURIDecl | ConstructionDecl | OrderingModeDecl | EmptyOrderDecl | RevalidationDecl | CopyNamespacesDecl | DecimalFormatDecl ) |
Import |
::= |
( SchemaImport | ModuleImport ) |
Separator |
::= |
";" |
NamespaceDecl |
::= |
"declare" "namespace" NCName "=" URILiteral |
BoundarySpaceDecl |
::= |
"declare" "boundary-space" ( "preserve" | "strip" ) |
DefaultNamespaceDecl |
::= |
"declare" "default" ( "element" | "function" ) "namespace" URILiteral |
OptionDecl |
::= |
"declare" "option" QName <StringLiteral> |
OrderingModeDecl |
::= |
"declare" "ordering" ( "ordered" | "unordered" ) |
EmptyOrderDecl |
::= |
"declare" "default" "order" "empty" ( <Greatest> | <Least> ) |
CopyNamespacesDecl |
::= |
"declare" "copy-namespaces" PreserveMode "," InheritMode |
DecimalFormatDecl |
::= |
"declare" ( ( "decimal-format" QName ) | ( "default" "decimal-format" ) ) ( DFPropertyName "=" <StringLiteral> )* |
DFPropertyName |
::= |
( "decimal-separator" | "grouping-separator" | "infinity" | "minus-sign" | "NaN" | "percent" | "per-mille" | "zero-digit" | "digit" | "pattern-separator" ) |
PreserveMode |
::= |
( "preserve" | "no-preserve" ) |
InheritMode |
::= |
( "inherit" | "no-inherit" ) |
DefaultCollationDecl |
::= |
"declare" "default" "collation" URILiteral |
BaseURIDecl |
::= |
"declare" "base-uri" URILiteral |
SchemaImport |
::= |
"import" "schema" ( SchemaPrefix )? URILiteral ( "at" URILiteral ( "," URILiteral )* )? |
SchemaPrefix |
::= |
( ( "namespace" NCName "=" ) | ( "default" "element" "namespace" ) ) |
ModuleImport |
::= |
"import" "module" ( "namespace" NCName "=" )? URILiteral ( "at" URILiteral ( "," URILiteral )* )? |
VarDecl |
::= |
"declare" "variable" "$" VarName ( TypeDeclaration )? ( ( ":=" VarValue ) | ( <External> ( ":=" VarDefaultValue )? ) ) |
VarValue |
::= |
ExprSingle |
VarDefaultValue |
::= |
ExprSingle |
ContextItemDecl |
::= |
"declare" "context" "item" ( "as" ItemType )? ( ( ":=" VarValue ) | ( <External> ( ":=" VarDefaultValue )? ) ) |
ConstructionDecl |
::= |
"declare" "construction" ( "strip" | "preserve" ) |
FunctionDecl |
::= |
"declare" FunctionOptions "function" QName "(" ( ParamList )? ")" ( "as" SequenceType )? ( FunctionBody | <External> ) |
FunctionOptions |
::= |
( ( PrivateOption | DeterministicOption | UpdatingOption ) )* |
PrivateOption |
::= |
( "private" | "public" ) |
DeterministicOption |
::= |
( "deterministic" | "nondeterministic" ) |
UpdatingOption |
::= |
"updating" |
ParamList |
::= |
Param ( "," Param )* |
Param |
::= |
"$" QName ( TypeDeclaration )? |
FunctionBody |
::= |
EnclosedExpr |
EnclosedExpr |
::= |
<Lbrace> Expr <Rbrace> |
QueryBody |
::= |
Expr |
Expr |
::= |
ExprSingle ( "," ExprSingle )* |
ExprSingle |
::= |
( FLWORExpr11 | QuantifiedExpr | SwitchExpr | TypeswitchExpr | IfExpr | TryCatchExpr | InsertExpr | DeleteExpr | RenameExpr | ReplaceExpr | TransformExpr | 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 |
::= |
QName |
PreviousItem |
::= |
QName |
NextItem |
::= |
QName |
CountClause |
::= |
"count" "$" VarName |
WhereClause |
::= |
"where" ExprSingle |
GroupByClause |
::= |
"group" "by" GroupingSpecList |
GroupingSpecList |
::= |
GroupingSpec ( "," GroupingSpec )* |
GroupingSpec |
::= |
"$" VarName ( "collation" URILiteral )? |
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" )? SequenceType "return" ExprSingle |
IfExpr |
::= |
"if" "(" Expr ")" "then" ExprSingle "else" ExprSingle |
TryCatchExpr |
::= |
TryClause ( CatchClause )+ |
TryClause |
::= |
"try" <Lbrace> TryTargetExpr <Rbrace> |
TryTargetExpr |
::= |
Expr |
CatchClause |
::= |
"catch" CatchErrorList ( CatchVars )? <Lbrace> Expr <Rbrace> |
CatchErrorList |
::= |
NameTest ( "|" NameTest )* |
CatchVars |
::= |
"(" CatchErrorCode ( "," CatchErrorDesc ( "," CatchErrorVal )? )? ")" |
CatchErrorCode |
::= |
"$" VarName |
CatchErrorDesc |
::= |
"$" VarName |
CatchErrorVal |
::= |
"$" VarName |
OperatorExpr |
::= |
OrExpr |
OrExpr |
::= |
AndExpr ( "or" AndExpr )* |
AndExpr |
::= |
ComparisonExpr ( "and" ComparisonExpr )* |
ComparisonExpr |
::= |
RangeExpr ( ( ValueComp | GeneralComp | NodeComp ) 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 | PathExpr | ExtensionExpr ) |
GeneralComp |
::= |
( "=" | "!=" | <LessThanOpOrTagO> | "<=" | ">" | ">=" ) |
ValueComp |
::= |
( "eq" | "ne" | "lt" | "le" | "gt" | "ge" ) |
NodeComp |
::= |
( "is" | "<<" | ">>" ) |
ValidateExpr |
::= |
"validate" ( ( ValidationMode | ( "as" TypeName ) ) )? <Lbrace> Expr <Rbrace> |
ValidationMode |
::= |
( "lax" | "strict" ) |
ExtensionExpr |
::= |
( Pragma )+ <Lbrace> ( Expr )? <Rbrace> |
Pragma |
::= |
<PragmaOpen> ( <S> )? QName ( <SForPragma> PragmaContents )? <PragmaClose> |
PragmaContents |
::= |
( <ExtensionContentChar> )* |
PathExpr |
::= |
( ( <Slash> ( RelativePathExpr )? ) | ( <SlashSlash> RelativePathExpr ) | RelativePathExpr ) |
RelativePathExpr |
::= |
StepExpr ( ( <Slash> | <SlashSlash> ) StepExpr )* |
StepExpr |
::= |
( FilterExpr | 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 |
::= |
( QName | Wildcard ) |
Wildcard |
::= |
( "*" | <NCNameColonStar> | <StarColonNCName> ) |
FilterExpr |
::= |
PrimaryExpr ( ( Predicate | DynamicFunctionInvocation ) )* |
PredicateList |
::= |
( Predicate )* |
Predicate |
::= |
"[" Expr "]" |
PrimaryExpr |
::= |
( Literal | VarRef | ParenthesizedExpr | ContextItemExpr | FunctionCall | OrderedExpr | UnorderedExpr | Constructor | FunctionItemExpr ) |
Literal |
::= |
( NumericLiteral | <StringLiteral> ) |
NumericLiteral |
::= |
( <IntegerLiteral> | <DecimalLiteral> | <DoubleLiteral> ) |
VarRef |
::= |
"$" VarName |
VarName |
::= |
QName |
ParenthesizedExpr |
::= |
"(" ( Expr )? ")" |
ContextItemExpr |
::= |
"." |
OrderedExpr |
::= |
"ordered" <Lbrace> Expr <Rbrace> |
UnorderedExpr |
::= |
"unordered" <Lbrace> Expr <Rbrace> |
FunctionCall |
::= |
FunctionQName "(" ( ExprSingle ( "," ExprSingle )* )? ")" |
Constructor |
::= |
( DirectConstructor | ComputedConstructor ) |
DirectConstructor |
::= |
( DirElemConstructor | DirCommentConstructor | DirPIConstructor ) |
DirElemConstructor |
::= |
( <LessThanOpOrTagO> | <StartTagOpen> ) <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 |
::= |
( <XmlCommentStartForElementContent> | <XmlCommentStart> ) DirCommentContents <XmlCommentEnd> |
DirCommentContents |
::= |
( ( <CommentContentChar> | <CommentContentCharDash> ) )* |
DirPIConstructor |
::= |
( <ProcessingInstructionStartForElementContent> | <ProcessingInstructionStart> ) <PITarget> ( <SForPI> DirPIContents )? <ProcessingInstructionEnd> |
DirPIContents |
::= |
( <PIContentChar> )* |
CDataSection |
::= |
( <CdataSectionStartForElementContent> | <CdataSectionStart> ) CDataSectionContents <CdataSectionEnd> |
CDataSectionContents |
::= |
( <CDataSectionChar> )* |
ComputedConstructor |
::= |
( CompDocConstructor | CompElemConstructor | CompAttrConstructor | CompNamespaceConstructor | CompTextConstructor | CompCommentConstructor | CompPIConstructor ) |
CompDocConstructor |
::= |
"document" <Lbrace> Expr <Rbrace> |
CompElemConstructor |
::= |
"element" ( QName | ( <Lbrace> Expr <Rbrace> ) ) <Lbrace> ( ContentExpr )? <Rbrace> |
ContentExpr |
::= |
Expr |
CompAttrConstructor |
::= |
"attribute" ( QName | ( <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 |
::= |
( LiteralFunctionItem | InlineFunction ) |
LiteralFunctionItem |
::= |
QName "#" <IntegerLiteral> |
InlineFunction |
::= |
"function" "(" ( ParamList )? ")" ( "as" SequenceType )? EnclosedExpr |
DynamicFunctionInvocation |
::= |
"(" ( ExprSingle ( "," ExprSingle )* )? ")" |
SingleType |
::= |
AtomicType ( "?" )? |
TypeDeclaration |
::= |
"as" SequenceType |
SequenceType |
::= |
( ( "empty-sequence" "(" ")" ) | ( ItemType ( OccurrenceIndicator )? ) ) |
OccurrenceIndicator |
::= |
( "?" | "*" | <Plus> ) |
ItemType |
::= |
( KindTest | ( "item" "(" ")" ) | FunctionTest | AtomicType | ParenthesizedItemType ) |
AtomicType |
::= |
QName |
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 |
::= |
QName |
ElementName |
::= |
QName |
TypeName |
::= |
QName |
FunctionTest |
::= |
( 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 |
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" ) |
FunctionQName |
::= |
( <QNameToken> | <QNameForPragma> | <Ascending> | <Descending> | <External> | <Greatest> | <Least> | "NaN" | "after" | "allowing" | "ancestor" | "ancestor-or-self" | "and" | "as" | "at" | "base-uri" | "before" | "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" | "deterministic" | "digit" | "div" | "document" | "else" | "empty" | "encoding" | "end" | "eq" | "every" | "except" | "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" | "nondeterministic" | "of" | "only" | "option" | "or" | "order" | "ordered" | "ordering" | "parent" | "pattern-separator" | "per-mille" | "percent" | "preceding" | "preceding-sibling" | "preserve" | "previous" | "private" | "public" | "rename" | "replace" | "return" | "revalidation" | "satisfies" | "schema" | "self" | "skip" | "sliding" | "some" | "stable" | "start" | "strict" | "strip" | "then" | "to" | "treat" | "try" | "tumbling" | "union" | "unordered" | "updating" | "validate" | "value" | "variable" | "version" | "when" | "where" | "window" | "with" | "xquery" | "zero-digit" ) |