START |
::= |
QueryList <EOF> |
QueryList |
::= |
Module ( "%%%" ( Module )? )* |
Module |
::= |
( VersionDecl )? ( LibraryModule | MainModule ) |
VersionDecl |
::= |
"xquery" ( "version" <StringLiteral> ( "encoding" <StringLiteral> )? ) Separator |
MainModule |
::= |
Prolog QueryBody |
LibraryModule |
::= |
ModuleDecl Prolog |
ModuleDecl |
::= |
"module" "namespace" NCName "=" URILiteral Separator |
Prolog |
::= |
( ( DefaultNamespaceDecl | Setter | NamespaceDecl | Import | FTOptionDecl ) Separator )* ( ( VarDecl | FunctionDecl | OptionDecl ) Separator )* |
Setter |
::= |
( BoundarySpaceDecl | DefaultCollationDecl | BaseURIDecl | ConstructionDecl | OrderingModeDecl | EmptyOrderDecl | RevalidationDecl | CopyNamespacesDecl ) |
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> |
FTOptionDecl |
::= |
"declare" "ft-option" FTMatchOptions |
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" ) |
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" "$" QName ( TypeDeclaration )? ( ( ":=" ExprSingle ) | ( <External> ) ) |
ConstructionDecl |
::= |
"declare" "construction" ( "strip" | "preserve" ) |
FunctionDecl |
::= |
"declare" ( "updating" )? "function" QName "(" ( ParamList )? ")" ( "as" SequenceType )? ( EnclosedExpr | <External> ) |
ParamList |
::= |
Param ( "," Param )* |
Param |
::= |
"$" QName ( TypeDeclaration )? |
EnclosedExpr |
::= |
<Lbrace> Expr <Rbrace> |
QueryBody |
::= |
Expr |
Expr |
::= |
ExprSingle ( "," ExprSingle )* |
ExprSingle |
::= |
( FLWORExpr10 | QuantifiedExpr | TypeswitchExpr | IfExpr | InsertExpr | DeleteExpr | RenameExpr | ReplaceExpr | TransformExpr | OrExpr ) |
FLWORExpr10 |
::= |
( ( ForClause | LetClause ) )+ ( WhereClause )? ( OrderByClause )? "return" ExprSingle |
ForClause |
::= |
"for" "$" VarName ( TypeDeclaration )? ( PositionalVar )? ( FTScoreVar )? "in" ExprSingle ( "," "$" VarName ( TypeDeclaration )? ( PositionalVar )? ( FTScoreVar )? "in" ExprSingle )* |
PositionalVar |
::= |
"at" "$" VarName |
FTScoreVar |
::= |
"score" "$" VarName |
LetClause |
::= |
"let" ( ( "$" VarName ( TypeDeclaration )? ) | FTScoreVar ) ":=" ExprSingle ( "," ( ( "$" VarName ( TypeDeclaration )? ) | FTScoreVar ) ":=" ExprSingle )* |
WhereClause |
::= |
"where" ExprSingle |
OrderByClause |
::= |
( ( "order" "by" ) | ( "stable" "order" "by" ) ) OrderSpecList |
OrderSpecList |
::= |
OrderSpec ( "," OrderSpec )* |
OrderSpec |
::= |
ExprSingle OrderModifier |
OrderModifier |
::= |
( ( <Ascending> | <Descending> ) )? ( "empty" ( <Greatest> | <Least> ) )? ( "collation" URILiteral )? |
QuantifiedExpr |
::= |
( "some" | "every" ) "$" VarName ( TypeDeclaration )? "in" ExprSingle ( "," "$" VarName ( TypeDeclaration )? "in" ExprSingle )* "satisfies" ExprSingle |
TypeswitchExpr |
::= |
"typeswitch" "(" Expr ")" ( CaseClause )+ "default" ( "$" VarName )? "return" ExprSingle |
CaseClause |
::= |
"case" ( "$" VarName "as" )? SequenceType "return" ExprSingle |
IfExpr |
::= |
"if" "(" Expr ")" "then" ExprSingle "else" ExprSingle |
OperatorExpr |
::= |
OrExpr |
OrExpr |
::= |
AndExpr ( "or" AndExpr )* |
AndExpr |
::= |
ComparisonExpr ( "and" ComparisonExpr )* |
ComparisonExpr |
::= |
FTContainsExpr ( ( ValueComp | GeneralComp | NodeComp ) FTContainsExpr )? |
FTContainsExpr |
::= |
RangeExpr ( ( "contains" "text" FTSelection ( FTIgnoreOption )? ) )? |
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 )? <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 PredicateList |
PredicateList |
::= |
( Predicate )* |
Predicate |
::= |
"[" Expr "]" |
PrimaryExpr |
::= |
( Literal | VarRef | ParenthesizedExpr | ContextItemExpr | FunctionCall | OrderedExpr | UnorderedExpr | Constructor ) |
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 | 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> |
CompTextConstructor |
::= |
"text" <Lbrace> Expr <Rbrace> |
CompCommentConstructor |
::= |
"comment" <Lbrace> Expr <Rbrace> |
CompPIConstructor |
::= |
"processing-instruction" ( NCName | ( <Lbrace> Expr <Rbrace> ) ) <Lbrace> ( Expr )? <Rbrace> |
SingleType |
::= |
AtomicType ( "?" )? |
TypeDeclaration |
::= |
"as" SequenceType |
SequenceType |
::= |
( ( "empty-sequence" "(" ")" ) | ( ItemType ( OccurrenceIndicator )? ) ) |
OccurrenceIndicator |
::= |
( "?" | "*" | <Plus> ) |
ItemType |
::= |
( KindTest | ( "item" "(" ")" ) | AtomicType ) |
AtomicType |
::= |
QName |
KindTest |
::= |
( DocumentTest | ElementTest | AttributeTest | SchemaElementTest | SchemaAttributeTest | PITest | CommentTest | TextTest | AnyKindTest ) |
AnyKindTest |
::= |
"node" "(" ")" |
DocumentTest |
::= |
"document-node" "(" ( ( ElementTest | SchemaElementTest ) )? ")" |
TextTest |
::= |
"text" "(" ")" |
CommentTest |
::= |
"comment" "(" ")" |
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 |
URILiteral |
::= |
<StringLiteral> |
FTSelection |
::= |
FTOr ( FTPosFilter )* |
FTWeight |
::= |
"weight" <Lbrace> Expr <Rbrace> |
FTOrExpr |
::= |
FTOr |
FTOr |
::= |
FTAnd ( "ftor" FTAnd )* |
FTAnd |
::= |
FTMildNot ( "ftand" FTMildNot )* |
FTMildNot |
::= |
FTUnaryNot ( ( "not" "in" ) FTUnaryNot )* |
FTUnaryNot |
::= |
( ( "ftnot" ) )? FTPrimaryWithOptions |
FTPrimaryWithOptions |
::= |
( FTPrimary ( FTMatchOptions )? ( FTWeight )? ) |
FTPrimary |
::= |
( ( FTWords ( FTTimes )? ) | ( "(" FTSelection ")" ) | FTExtensionSelection ) |
FTWords |
::= |
FTWordsValue ( FTAnyallOption )? |
FTWordsValue |
::= |
( Literal | ( <Lbrace> Expr <Rbrace> ) ) |
FTExtensionSelection |
::= |
( Pragma )+ <Lbrace> ( FTSelection )? <Rbrace> |
FTAnyallOption |
::= |
( ( "any" ( "word" )? ) | ( "all" ( "words" )? ) | "phrase" ) |
FTTimes |
::= |
"occurs" FTRange "times" |
FTRange |
::= |
( ( "exactly" AdditiveExpr ) | ( "at" <Least> AdditiveExpr ) | ( "at" "most" AdditiveExpr ) | ( "from" AdditiveExpr "to" AdditiveExpr ) ) |
FTPosFilter |
::= |
( FTOrder | FTWindow | FTDistance | FTScope | FTContent ) |
FTOrder |
::= |
"ordered" |
FTWindow |
::= |
"window" AdditiveExpr FTUnit |
FTDistance |
::= |
"distance" FTRange FTUnit |
FTUnit |
::= |
( "words" | "sentences" | "paragraphs" ) |
FTScope |
::= |
( "same" | "different" ) FTBigUnit |
FTBigUnit |
::= |
( "sentence" | "paragraph" ) |
FTContent |
::= |
( ( "at" "start" ) | ( "at" "end" ) | ( "entire" "content" ) ) |
FTMatchOptions |
::= |
( "using" FTMatchOption )+ |
FTMatchOption |
::= |
( FTLanguageOption | FTWildCardOption | FTThesaurusOption | FTStemOption | FTCaseOption | FTDiacriticsOption | FTStopWordOption | FTExtensionOption ) |
FTCaseOption |
::= |
( ( "case" "insensitive" ) | ( "case" "sensitive" ) | "lowercase" | "uppercase" ) |
FTDiacriticsOption |
::= |
( ( "diacritics" "insensitive" ) | ( "diacritics" "sensitive" ) ) |
FTStemOption |
::= |
( "stemming" | ( "no" "stemming" ) ) |
FTThesaurusOption |
::= |
( ( "thesaurus" ( FTThesaurusID | "default" ) ) | ( "thesaurus" "(" ( FTThesaurusID | "default" ) ( "," FTThesaurusID )* ")" ) | ( "no" "thesaurus" ) ) |
FTThesaurusID |
::= |
"at" URILiteral ( "relationship" <StringLiteral> )? ( FTRange "levels" )? |
FTStopWordOption |
::= |
( ( "stop" "words" FTStopWords ( FTStopWordsInclExcl )* ) | ( "stop" "words" "default" ( FTStopWordsInclExcl )* ) | ( "no" "stop" "words" ) ) |
FTStopWords |
::= |
( ( "at" URILiteral ) | ( "(" <StringLiteral> ( "," <StringLiteral> )* ")" ) ) |
FTStopWordsInclExcl |
::= |
( "union" | "except" ) FTStopWords |
FTLanguageOption |
::= |
"language" <StringLiteral> |
FTWildCardOption |
::= |
( "wildcards" | ( "no" "wildcards" ) ) |
FTExtensionOption |
::= |
"option" QName <StringLiteral> |
FTIgnoreOption |
::= |
"without" "content" UnionExpr |
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" | "if" | "item" | "node" | "processing-instruction" | "schema-attribute" | "schema-element" | "text" | "typeswitch" ) |
FunctionQName |
::= |
( <QNameToken> | <QNameForPragma> | <Ascending> | <Descending> | <External> | <Greatest> | <Least> | "after" | "all" | "ancestor" | "ancestor-or-self" | "and" | "any" | "as" | "at" | "base-uri" | "before" | "boundary-space" | "by" | "case" | "cast" | "castable" | "child" | "collation" | "construction" | "contains" | "content" | "copy" | "copy-namespaces" | "declare" | "default" | "delete" | "descendant" | "descendant-or-self" | "diacritics" | "different" | "distance" | "div" | "document" | "else" | "empty" | "encoding" | "end" | "entire" | "eq" | "every" | "exactly" | "except" | "first" | "following" | "following-sibling" | "for" | "from" | "ft-option" | "ftand" | "ftnot" | "ftor" | "function" | "ge" | "gt" | "idiv" | "import" | "in" | "inherit" | "insensitive" | "insert" | "instance" | "intersect" | "into" | "is" | "language" | "last" | "lax" | "le" | "let" | "levels" | "lowercase" | "lt" | "mod" | "modify" | "module" | "most" | "namespace" | "ne" | "no" | "no-inherit" | "no-preserve" | "nodes" | "not" | "occurs" | "of" | "option" | "or" | "order" | "ordered" | "ordering" | "paragraph" | "paragraphs" | "parent" | "phrase" | "preceding" | "preceding-sibling" | "preserve" | "relationship" | "rename" | "replace" | "return" | "revalidation" | "same" | "satisfies" | "schema" | "score" | "self" | "sensitive" | "sentence" | "sentences" | "skip" | "some" | "stable" | "start" | "stemming" | "stop" | "strict" | "strip" | "then" | "thesaurus" | "times" | "to" | "treat" | "union" | "unordered" | "updating" | "uppercase" | "using" | "validate" | "value" | "variable" | "version" | "weight" | "where" | "wildcards" | "window" | "with" | "without" | "word" | "words" | "xquery" ) |