| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180 |
- <?xqlint
- /* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
- define(function(require, exports, module){
- var XQueryParser = exports.XQueryParser = function XQueryParser(string, parsingEventHandler)
- {
- init(string, parsingEventHandler);
- ?>
- XQuery ::= Module EOF
- Module ::= VersionDecl? ( LibraryModule | MainModule )
- VersionDecl
- ::= 'xquery' ( 'encoding' StringLiteral | 'version' StringLiteral ( 'encoding' StringLiteral )? ) Separator
- LibraryModule
- ::= ModuleDecl Prolog
- ModuleDecl
- ::= 'module' 'namespace' NCName '=' URILiteral Separator
- Prolog ::= ( ( DefaultNamespaceDecl | Setter | NamespaceDecl | Import | FTOptionDecl ) 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
- FTOptionDecl
- ::= 'declare' 'ft-option' FTMatchOptions
- AnnotatedDecl
- ::= 'declare' ( CompatibilityAnnotation | Annotation )* ( VarDecl | FunctionDecl | CollectionDecl | IndexDecl | ICDecl )
- 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 )? )
- ParamList
- ::= Param ( ',' Param )*
- Param ::= '$' EQName TypeDeclaration?
- FunctionBody
- ::= EnclosedExpr
- EnclosedExpr
- ::= '{' Expr '}'
- OptionDecl
- ::= 'declare' 'option' EQName StringLiteral
- Expr ::= ExprSingle ( ',' ExprSingle )*
- FLWORExpr
- ::= InitialClause IntermediateClause* ReturnClause
- InitialClause
- ::= ForClause
- | LetClause
- | WindowClause
- IntermediateClause
- ::= InitialClause
- | WhereClause
- | GroupByClause
- | OrderByClause
- | CountClause
- ForClause
- ::= 'for' ForBinding ( ',' ForBinding )*
- ForBinding
- ::= '$' VarName TypeDeclaration? AllowingEmpty? PositionalVar? FTScoreVar? 'in' ExprSingle
- AllowingEmpty
- ::= 'allowing' 'empty'
- PositionalVar
- ::= 'at' '$' VarName
- FTScoreVar
- ::= 'score' '$' VarName
- LetClause
- ::= 'let' LetBinding ( ',' LetBinding )*
- LetBinding
- ::= ( '$' VarName TypeDeclaration? | FTScoreVar ) ':=' 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' '{' TryTargetExpr '}'
- TryTargetExpr
- ::= Expr
- CatchClause
- ::= 'catch' CatchErrorList '{' Expr '}'
- CatchErrorList
- ::= NameTest ( '|' NameTest )*
- OrExpr ::= AndExpr ( 'or' AndExpr )*
- AndExpr ::= ComparisonExpr ( 'and' ComparisonExpr )*
- ComparisonExpr
- ::= FTContainsExpr ( ( ValueComp | GeneralComp | NodeComp ) FTContainsExpr )?
- FTContainsExpr
- ::= StringConcatExpr ( 'contains' 'text' FTSelection FTIgnoreOption? )?
- StringConcatExpr
- ::= RangeExpr ( '||' RangeExpr )*
- RangeExpr
- ::= AdditiveExpr ( 'to' AdditiveExpr )?
- AdditiveExpr
- ::= MultiplicativeExpr ( ( '+' | '-' ) 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
- ::= ( '-' | '+' )* ValueExpr
- ValueExpr
- ::= ValidateExpr
- | SimpleMapExpr
- | ExtensionExpr
- SimpleMapExpr
- ::= PathExpr ('!' PathExpr)*
- GeneralComp
- ::= '='
- | '!='
- | '<'
- | '<='
- | '>'
- | '>='
- ValueComp
- ::= 'eq'
- | 'ne'
- | 'lt'
- | 'le'
- | 'gt'
- | 'ge'
- NodeComp ::= 'is'
- | '<<'
- | '>>'
- ValidateExpr
- ::= 'validate' ( ValidationMode | 'type' TypeName )? '{' Expr '}'
- ValidationMode
- ::= 'lax'
- | 'strict'
- ExtensionExpr
- ::= Pragma+ '{' Expr? '}'
- Pragma ::= '(#' S? EQName ( S PragmaContents )? '#)'
- /* ws: explicit */
- PathExpr ::= '/' ( RelativePathExpr / )
- | '//' RelativePathExpr
- | RelativePathExpr
- RelativePathExpr
- ::= StepExpr ( ( '/' | '//' | '!' ) 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
- PostfixExpr
- ::= PrimaryExpr ( Predicate | ArgumentList )*
- ArgumentList
- ::= '(' ( Argument ( ',' Argument )* )? ')'
- PredicateList
- ::= Predicate*
- Predicate
- ::= '[' Expr ']'
- Literal ::= NumericLiteral
- | StringLiteral
- NumericLiteral
- ::= IntegerLiteral
- | DecimalLiteral
- | DoubleLiteral
- VarRef ::= '$' VarName
- VarName ::= EQName
- ParenthesizedExpr
- ::= '(' Expr? ')'
- ContextItemExpr
- ::= '.'
- OrderedExpr
- ::= 'ordered' '{' Expr '}'
- UnorderedExpr
- ::= 'unordered' '{' Expr '}'
- FunctionCall
- ::= FunctionName ArgumentList
- Argument ::= ExprSingle
- | ArgumentPlaceholder
- ArgumentPlaceholder
- ::= '?'
- Constructor
- ::= DirectConstructor
- | ComputedConstructor
- DirectConstructor
- ::= DirElemConstructor
- | DirCommentConstructor
- | DirPIConstructor
- DirElemConstructor
- ::= '<' QName DirAttributeList ( '/>' | '>' DirElemContent* '</' QName S? '>' )
- /* ws: explicit */
- DirAttributeList
- ::= ( S ( QName S? '=' S? DirAttributeValue )? )*
- /* ws: explicit */
- DirAttributeValue
- ::= '"' ( EscapeQuot | QuotAttrValueContent )* '"'
- | "'" ( EscapeApos | AposAttrValueContent )* "'"
- /* ws: explicit */
- QuotAttrValueContent
- ::= QuotAttrContentChar
- | CommonContent
- AposAttrValueContent
- ::= AposAttrContentChar
- | CommonContent
- DirElemContent
- ::= DirectConstructor
- | CDataSection
- | CommonContent
- | ElementContentChar
- DirCommentConstructor
- ::= '<!--' DirCommentContents '-->'
- /* ws: explicit */
- DirPIConstructor
- ::= '<?' PITarget ( S DirPIContents )? '?>'
- /* ws: explicit */
- ComputedConstructor
- ::= CompDocConstructor
- | CompElemConstructor
- | CompAttrConstructor
- | CompNamespaceConstructor
- | CompTextConstructor
- | CompCommentConstructor
- | CompPIConstructor
- CompElemConstructor
- ::= 'element' ( EQName | '{' Expr '}' ) '{' ContentExpr? '}'
- CompNamespaceConstructor
- ::= 'namespace' ( Prefix | '{' PrefixExpr '}' ) '{' URIExpr '}'
- Prefix ::= NCName
- PrefixExpr
- ::= Expr
- URIExpr ::= Expr
- FunctionItemExpr
- ::= NamedFunctionRef
- | InlineFunctionExpr
- NamedFunctionRef
- ::= EQName '#' IntegerLiteral
- InlineFunctionExpr
- ::= Annotation* 'function' '(' ParamList? ')' ( 'as' SequenceType )? FunctionBody
- SingleType
- ::= SimpleTypeName '?'?
- TypeDeclaration
- ::= 'as' SequenceType
- SequenceType
- ::= 'empty-sequence' '(' ')'
- | ItemType ( OccurrenceIndicator / )
- OccurrenceIndicator
- ::= '?'
- | '*'^OccurrenceIndicator
- | '+'
- ItemType ::= KindTest
- | 'item' '(' ')'
- | FunctionTest
- | AtomicOrUnionType
- | ParenthesizedItemType
- | JSONTest
- | StructuredItemTest
- JSONTest ::=
- JSONItemTest
- | JSONObjectTest
- | JSONArrayTest
- StructuredItemTest ::= "structured-item" "(" ")"
- JSONItemTest ::= "json-item" "(" ")"
- JSONObjectTest ::= "object" "(" ")"
- JSONArrayTest ::= "array" "(" ")"
- AtomicOrUnionType
- ::= EQName
- KindTest ::= DocumentTest
- | ElementTest
- | AttributeTest
- | SchemaElementTest
- | SchemaAttributeTest
- | PITest
- | CommentTest
- | TextTest
- | NamespaceNodeTest
- | JSONTest
- | 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 ')'
- 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
- FTSelection
- ::= FTOr FTPosFilter*
- FTWeight ::= 'weight' '{' Expr '}'
- 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
- ::= StringLiteral
- | '{' Expr '}'
- FTExtensionSelection
- ::= Pragma+ '{' FTSelection? '}'
- FTAnyallOption
- ::= 'any' 'word'?
- | 'all' 'words'?
- | 'phrase'
- FTTimes ::= 'occurs' FTRange 'times'
- FTRange ::= 'exactly' AdditiveExpr
- | 'at' ( 'least' AdditiveExpr | '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' | 'end' )
- | 'entire' 'content'
- FTMatchOptions
- ::= ( 'using' FTMatchOption )+
- FTMatchOption
- ::= FTLanguageOption
- | FTWildCardOption
- | FTThesaurusOption
- | FTStemOption
- | FTCaseOption
- | FTDiacriticsOption
- | FTStopWordOption
- | FTExtensionOption
- FTCaseOption
- ::= 'case' ( 'insensitive' | 'sensitive' )
- | 'lowercase'
- | 'uppercase'
- FTDiacriticsOption
- ::= 'diacritics' ( 'insensitive' | 'sensitive' )
- FTStemOption
- ::= 'stemming'
- | 'no' 'stemming'
- FTThesaurusOption
- ::= 'thesaurus' ( FTThesaurusID | 'default' | '(' ( FTThesaurusID | 'default' ) ( ',' FTThesaurusID )* ')' )
- | 'no' 'thesaurus'
- FTThesaurusID
- ::= 'at' URILiteral ( 'relationship' StringLiteral )? ( FTLiteralRange 'levels' )?
- FTLiteralRange
- ::= 'exactly' IntegerLiteral
- | 'at' ( 'least' IntegerLiteral | 'most' IntegerLiteral )
- | 'from' IntegerLiteral 'to' IntegerLiteral
- FTStopWordOption
- ::= 'stop' 'words' ( FTStopWords FTStopWordsInclExcl* | 'default' FTStopWordsInclExcl* )
- | 'no' 'stop' 'words'
- FTStopWords
- ::= 'at' URILiteral
- | '(' StringLiteral ( ',' StringLiteral )* ')'
- FTStopWordsInclExcl
- ::= ( 'union' | 'except' ) FTStopWords
- FTLanguageOption
- ::= 'language' StringLiteral
- FTWildCardOption
- ::= 'wildcards'
- | 'no' 'wildcards'
- FTExtensionOption
- ::= 'option' EQName StringLiteral
- FTIgnoreOption
- ::= 'without' 'content' UnionExpr
- CollectionDecl
- ::= 'collection' EQName CollectionTypeDecl?
- CollectionTypeDecl
- ::= 'as' KindTest OccurrenceIndicator?
- IndexName
- ::= EQName
- IndexDomainExpr
- ::= PathExpr
- IndexKeySpec
- ::= IndexKeyExpr IndexKeyTypeDecl? IndexKeyCollation?
- IndexKeyExpr
- ::= PathExpr
- IndexKeyTypeDecl
- ::= 'as' AtomicType OccurrenceIndicator?
- AtomicType
- ::= EQName
- IndexKeyCollation
- ::= 'collation' URILiteral
- IndexDecl
- ::= 'index' IndexName 'on' 'nodes' IndexDomainExpr 'by' IndexKeySpec ( ',' IndexKeySpec )*
- ICDecl ::= 'integrity' 'constraint' EQName ( ICCollection | ICForeignKey )
- ICCollection
- ::= 'on' 'collection' EQName ( ICCollSequence | ICCollSequenceUnique | ICCollNode )
- ICCollSequence
- ::= VarRef 'check' ExprSingle
- ICCollSequenceUnique
- ::= 'node' VarRef 'check' 'unique' 'key' PathExpr
- ICCollNode
- ::= 'foreach' 'node' VarRef 'check' ExprSingle
- ICForeignKey
- ::= 'foreign' 'key' ICForeignKeySource ICForeignKeyTarget
- ICForeignKeySource
- ::= 'from' ICForeignKeyValues
- ICForeignKeyTarget
- ::= 'to' ICForeignKeyValues
- ICForeignKeyValues
- ::= 'collection' EQName 'node' VarRef 'key' PathExpr
- Comment ::= '(:' ( CommentContents | Comment )* ':)'
- /* ws: explicit */
- Whitespace
- ::= S^WS
- | Comment
- /* ws: definition */
- EQName ::= FunctionName
- | 'attribute'
- | 'comment'
- | 'document-node'
- | 'element'
- | 'empty-sequence'
- | 'function'
- | 'if'
- | 'item'
- | 'namespace-node'
- | 'node'
- | 'processing-instruction'
- | 'schema-attribute'
- | 'schema-element'
- | 'switch'
- | 'text'
- | 'typeswitch'
- FunctionName
- ::= EQName^Token
- | 'after'
- | 'ancestor'
- | 'ancestor-or-self'
- | 'and'
- | 'as'
- | 'ascending'
- | 'before'
- | 'case'
- | 'cast'
- | 'castable'
- | 'child'
- | 'collation'
- | 'copy'
- | 'count'
- | 'declare'
- | 'default'
- | 'delete'
- | 'descendant'
- | 'descendant-or-self'
- | 'descending'
- | 'div'
- | 'document'
- | 'else'
- | 'empty'
- | 'end'
- | 'eq'
- | 'every'
- | 'except'
- | 'first'
- | 'following'
- | 'following-sibling'
- | 'for'
- | 'ge'
- | 'group'
- | 'gt'
- | 'idiv'
- | 'import'
- | 'insert'
- | 'instance'
- | 'intersect'
- | 'into'
- | 'is'
- | 'last'
- | 'le'
- | 'let'
- | 'lt'
- | 'mod'
- | 'modify'
- | 'module'
- | 'namespace'
- | 'ne'
- | 'only'
- | 'or'
- | 'order'
- | 'ordered'
- | 'parent'
- | 'preceding'
- | 'preceding-sibling'
- | 'rename'
- | 'replace'
- | 'return'
- | 'satisfies'
- | 'self'
- | 'some'
- | 'stable'
- | 'start'
- | 'to'
- | 'treat'
- | 'try'
- | 'union'
- | 'unordered'
- | 'validate'
- | 'where'
- | 'with'
- | 'xquery'
- | 'allowing'
- | 'at'
- | 'base-uri'
- | 'boundary-space'
- | 'break'
- | 'catch'
- | 'construction'
- | 'context'
- | 'continue'
- | 'copy-namespaces'
- | 'decimal-format'
- | 'encoding'
- | 'exit'
- | 'external'
- | 'ft-option'
- | 'in'
- | 'index'
- | 'integrity'
- | 'lax'
- | 'nodes'
- | 'option'
- | 'ordering'
- | 'revalidation'
- | 'schema'
- | 'score'
- | 'sliding'
- | 'strict'
- | 'tumbling'
- | 'type'
- | 'updating'
- | 'value'
- | 'variable'
- | 'version'
- | 'while'
- | 'constraint'
- | 'loop'
- | 'returning'
- | 'object'
- | 'json-item'
- | 'array'
- NCName ::= NCName^Token
- | 'after'
- | 'and'
- | 'as'
- | 'ascending'
- | 'before'
- | 'case'
- | 'cast'
- | 'castable'
- | 'collation'
- | 'count'
- | 'default'
- | 'descending'
- | 'div'
- | 'else'
- | 'empty'
- | 'end'
- | 'eq'
- | 'except'
- | 'for'
- | 'ge'
- | 'group'
- | 'gt'
- | 'idiv'
- | 'instance'
- | 'intersect'
- | 'into'
- | 'is'
- | 'le'
- | 'let'
- | 'lt'
- | 'mod'
- | 'modify'
- | 'ne'
- | 'only'
- | 'or'
- | 'order'
- | 'return'
- | 'satisfies'
- | 'stable'
- | 'start'
- | 'to'
- | 'treat'
- | 'union'
- | 'where'
- | 'with'
- | 'ancestor'
- | 'ancestor-or-self'
- | 'attribute'
- | 'child'
- | 'comment'
- | 'copy'
- | 'declare'
- | 'delete'
- | 'descendant'
- | 'descendant-or-self'
- | 'document'
- | 'document-node'
- | 'element'
- | 'empty-sequence'
- | 'every'
- | 'first'
- | 'following'
- | 'following-sibling'
- | 'function'
- | 'if'
- | 'import'
- | 'insert'
- | 'item'
- | 'last'
- | 'module'
- | 'namespace'
- | 'namespace-node'
- | 'node'
- | 'ordered'
- | 'parent'
- | 'preceding'
- | 'preceding-sibling'
- | 'processing-instruction'
- | 'rename'
- | 'replace'
- | 'schema-attribute'
- | 'schema-element'
- | 'self'
- | 'some'
- | 'switch'
- | 'text'
- | 'try'
- | 'typeswitch'
- | 'unordered'
- | 'validate'
- | 'variable'
- | 'xquery'
- | 'allowing'
- | 'at'
- | 'base-uri'
- | 'boundary-space'
- | 'break'
- | 'catch'
- | 'construction'
- | 'context'
- | 'continue'
- | 'copy-namespaces'
- | 'decimal-format'
- | 'encoding'
- | 'exit'
- | 'external'
- | 'ft-option'
- | 'in'
- | 'index'
- | 'integrity'
- | 'lax'
- | 'nodes'
- | 'option'
- | 'ordering'
- | 'revalidation'
- | 'schema'
- | 'score'
- | 'sliding'
- | 'strict'
- | 'tumbling'
- | 'type'
- | 'updating'
- | 'value'
- | 'version'
- | 'while'
- | 'constraint'
- | 'loop'
- | 'returning'
- MainModule
- ::= Prolog Program
- Program ::= StatementsAndOptionalExpr
- Statements
- ::= Statement*
- StatementsAndExpr
- ::= Statements Expr
- StatementsAndOptionalExpr
- ::= Statements Expr?
- Statement
- ::= ApplyStatement
- | AssignStatement
- | BlockStatement
- | BreakStatement
- | ContinueStatement
- | ExitStatement
- | FLWORStatement
- | IfStatement
- | SwitchStatement
- | TryCatchStatement
- | TypeswitchStatement
- | VarDeclStatement
- | WhileStatement
- ApplyStatement
- ::= ExprSimple ';'
- AssignStatement
- ::= '$' VarName ':=' ExprSingle ';'
- BlockStatement
- ::= '{' Statements '}'
- BreakStatement
- ::= 'break' 'loop' ';'
- ContinueStatement
- ::= 'continue' 'loop' ';'
- ExitStatement
- ::= 'exit' 'returning' ExprSingle ';'
- FLWORStatement
- ::= InitialClause IntermediateClause* ReturnStatement
- ReturnStatement
- ::= 'return' Statement
- IfStatement
- ::= 'if' '(' Expr ')' 'then' Statement 'else' Statement
- SwitchStatement
- ::= 'switch' '(' Expr ')' SwitchCaseStatement+ 'default' 'return' Statement
- SwitchCaseStatement
- ::= ( 'case' SwitchCaseOperand )+ 'return' Statement
- TryCatchStatement
- ::= 'try' BlockStatement ( 'catch' CatchErrorList BlockStatement )+
- TypeswitchStatement
- ::= 'typeswitch' '(' Expr ')' CaseStatement+ 'default' ( '$' VarName )? 'return' Statement
- CaseStatement
- ::= 'case' ( '$' VarName 'as' )? SequenceType 'return' Statement
- VarDeclStatement
- ::= Annotation* 'variable' '$' VarName TypeDeclaration? ( ':=' ExprSingle )? ( ',' '$' VarName TypeDeclaration? ( ':=' ExprSingle )? )* ';'
- WhileStatement
- ::= 'while' '(' Expr ')' Statement
- ExprSingle
- ::= ExprSimple
- | FLWORExpr
- | IfExpr
- | SwitchExpr
- | TryCatchExpr
- | TypeswitchExpr
- ExprSimple
- ::= QuantifiedExpr
- | OrExpr
- | InsertExpr
- | DeleteExpr
- | RenameExpr
- | ReplaceExpr
- | TransformExpr
- | JSONDeleteExpr
- | JSONInsertExpr
- | JSONRenameExpr
- | JSONReplaceExpr
- | JSONAppendExpr
-
- JSONDeleteExpr ::= "delete" "json" PostfixExpr
-
- JSONInsertExpr ::= "insert" "json" ExprSingle "into" ExprSingle ("at" "position" ExprSingle)?
-
- JSONRenameExpr ::= "rename" "json" PostfixExpr "as" ExprSingle
-
- JSONReplaceExpr ::= "replace" "json" "value" "of" PostfixExpr "with" ExprSingle
-
- JSONAppendExpr ::= "append" "json" ExprSingle "into" ExprSingle
- CommonContent
- ::= PredefinedEntityRef
- | CharRef
- | '{{'
- | '}}'
- | BlockExpr
- ContentExpr
- ::= StatementsAndExpr
- CompDocConstructor
- ::= 'document' BlockExpr
- CompAttrConstructor
- ::= 'attribute' ( EQName | '{' Expr '}' ) ( '{' '}' | BlockExpr )
- CompPIConstructor
- ::= 'processing-instruction' ( NCName | '{' Expr '}' ) ( '{' '}' | BlockExpr )
- CompCommentConstructor
- ::= 'comment' BlockExpr
- CompTextConstructor
- ::= 'text' BlockExpr
- PrimaryExpr
- ::= Literal
- | VarRef
- | ParenthesizedExpr
- | ContextItemExpr
- | FunctionCall
- | OrderedExpr
- | UnorderedExpr
- | Constructor
- | FunctionItemExpr
- | BlockExpr
- | ObjectConstructor
- | ArrayConstructor
- | JSONSimpleObjectUnion
- JSONSimpleObjectUnion
- ::= '{|' Expr? '|}'
-
- ObjectConstructor ::= "{" ( PairConstructor ("," PairConstructor)* )? "}"
-
- PairConstructor ::= ExprSingle ":" ExprSingle
-
- ArrayConstructor ::= "[" Expr? "]"
-
- BlockExpr
- ::= '{' StatementsAndOptionalExpr '}'
- FunctionDecl
- ::= 'function' EQName '(' ParamList? ')' ( 'as' SequenceType )? ( '{' StatementsAndOptionalExpr '}' | 'external' )
- <?TOKENS?>
- PragmaContents
- ::= ( Char* - ( Char* '#)' Char* ) ) &'#'
- DirCommentContents
- ::= ( ( Char - '-' ) | '-' ( Char - '-' ) )*
- DirPIContents
- ::= ( Char* - ( Char* '?>' Char* ) ) &'?'
- CDataSection
- ::= '<![CDATA[' CDataSectionContents ']]>'
- CDataSectionContents
- ::= Char* - ( Char* ']]>' Char* )
- Wildcard ::= "*"
- | (NCName ":" "*")
- | ("*" ":" NCName)
- | (BracedURILiteral "*")
- EQName ::= QName
- | URIQualifiedName
- URIQualifiedName
- ::= BracedURILiteral NCName
- BracedURILiteral
- ::= 'Q' '{' (PredefinedEntityRef | CharRef | [^&{}] )* '}'
- URILiteral
- ::= StringLiteral
- IntegerLiteral
- ::= Digits
- DecimalLiteral
- ::= '.' Digits
- | Digits '.' [0-9]*
- /* ws: explicit */
- DoubleLiteral
- ::= ( '.' Digits | Digits ( '.' [0-9]* )? ) [Ee] [+#x002D]? Digits
- /* ws: explicit */
- StringLiteral
- ::= '"' ( PredefinedEntityRef | CharRef | EscapeQuot | [^"&] )* '"'
- | "'" ( PredefinedEntityRef | CharRef | EscapeApos | [^&'] )* "'"
- /* ws: explicit */
- PredefinedEntityRef
- ::= '&' ( 'lt' | 'gt' | 'amp' | 'quot' | 'apos' ) ';'
- /* ws: explicit */
- EscapeQuot
- ::= '""'
- EscapeApos
- ::= "''"
- ElementContentChar
- ::= Char - [&<{}]
- QuotAttrContentChar
- ::= Char - ["&<{}]
- AposAttrContentChar
- ::= Char - [&'<{}]
- PITarget ::= NCName - ( ( 'X' | 'x' ) ( 'M' | 'm' ) ( 'L' | 'l' ) )
- Name ::= NameStartChar NameChar*
- NameStartChar
- ::= [:A-Z_a-z#x00C0-#x00D6#x00D8-#x00F6#x00F8-#x02FF#x0370-#x037D#x037F-#x1FFF#x200C-#x200D#x2070-#x218F#x2C00-#x2FEF#x3001-#xD7FF#xF900-#xFDCF#xFDF0-#xFFFD#x10000-#xEFFFF]
- NameChar ::= NameStartChar
- | [-.0-9#x00B7#x0300-#x036F#x203F-#x2040]
- NCName ::= Name - ( Char* ':' Char* )
- Char ::= [#x0009#x000A#x000D#x0020-#xD7FF#xE000-#xFFFD#x10000-#x10FFFF]
- QName ::= PrefixedName
- | UnprefixedName
- PrefixedName
- ::= Prefix ':' LocalPart
- UnprefixedName
- ::= LocalPart
- Prefix ::= NCName
- LocalPart
- ::= NCName
- S ::= [#x0009#x000A#x000D#x0020]+
- CharRef ::= '&#' [0-9]+ ';'
- | '&#x' [0-9A-Fa-f]+ ';'
- Digits ::= [0-9]+
- CommentContents
- ::= ( ( Char+ - ( Char* ( '(:' | ':)' ) Char* ) ) - ( Char* '(' ) ) &':'
- | ( Char+ - ( Char* ( '(:' | ':)' ) Char* ) ) &'('
- EOF ::= $
- NonNCNameChar
- ::= $
- | ':'
- | ( Char - NameChar )
- DelimitingChar
- ::= NonNCNameChar
- | '-'
- | '.'
- DelimitingChar
- \\ IntegerLiteral DecimalLiteral DoubleLiteral
- NonNCNameChar
- \\ EQName^Token QName NCName^Token 'NaN' 'after' 'all'
- 'allowing' 'ancestor' 'ancestor-or-self' 'and' 'any'
- 'append' 'array' 'as' 'ascending' 'at' 'attribute'
- 'base-uri' 'before' 'boundary-space' 'break' 'by' 'case'
- 'cast' 'castable' 'catch' 'check' 'child' 'collation'
- 'collection' 'comment' 'constraint' 'construction'
- 'contains' 'content' 'context' 'continue' 'copy'
- 'copy-namespaces' 'count' 'decimal-format'
- 'decimal-separator' 'declare' 'default' 'delete'
- 'descendant' 'descendant-or-self' 'descending'
- 'diacritics' 'different' 'digit' 'distance' 'div'
- 'document' 'document-node' 'element' 'else' 'empty'
- 'empty-sequence' 'encoding' 'end' 'entire' 'eq' 'every'
- 'exactly' 'except' 'exit' 'external' 'first' 'following'
- 'following-sibling' 'for' 'foreach' 'foreign' 'from'
- 'ft-option' 'ftand' 'ftnot' 'ftor' 'function' 'ge'
- 'greatest' 'group' 'grouping-separator' 'gt' 'idiv' 'if'
- 'import' 'in' 'index' 'infinity' 'inherit' 'insensitive'
- 'insert' 'instance' 'integrity' 'intersect' 'into' 'is'
- 'item' 'json' 'json-item' 'key' 'language' 'last' 'lax'
- 'le' 'least' 'let' 'levels' 'loop' 'lowercase' 'lt'
- 'minus-sign' 'mod' 'modify' 'module' 'most' 'namespace'
- 'namespace-node' 'ne' 'next' 'no' 'no-inherit'
- 'no-preserve' 'node' 'nodes' 'not' 'object' 'occurs'
- 'of' 'on' 'only' 'option' 'or' 'order' 'ordered'
- 'ordering' 'paragraph' 'paragraphs' 'parent'
- 'pattern-separator' 'per-mille' 'percent' 'phrase'
- 'position' 'preceding' 'preceding-sibling' 'preserve'
- 'previous' 'processing-instruction' 'relationship'
- 'rename' 'replace' 'return' 'returning' 'revalidation'
- 'same' 'satisfies' 'schema' 'schema-attribute'
- 'schema-element' 'score' 'self' 'sensitive' 'sentence'
- 'sentences' 'skip' 'sliding' 'some' 'stable' 'start'
- 'stemming' 'stop' 'strict' 'strip' 'structured-item'
- 'switch' 'text' 'then' 'thesaurus' 'times' 'to'
- 'treat' 'try' 'tumbling' 'type' 'typeswitch' 'union'
- 'unique' 'unordered' 'updating' 'uppercase' 'using'
- 'validate' 'value' 'variable' 'version' 'weight'
- 'when' 'where' 'while' 'wildcards' 'window' 'with'
- 'without' 'word' 'words' 'xquery' 'zero-digit'
- '*' << Wildcard '*'^OccurrenceIndicator
- EQName^Token
- << 'after' 'ancestor' 'ancestor-or-self' 'and' 'as' 'ascending' 'attribute' 'before' 'case' 'cast' 'castable' 'child' 'collation' 'comment' 'copy' 'count' 'declare' 'default' 'delete' 'descendant' 'descendant-or-self' 'descending' 'div' 'document' 'document-node' 'element' 'else' 'empty' 'empty-sequence' 'end' 'eq' 'every' 'except' 'first' 'following' 'following-sibling' 'for' 'function' 'ge' 'group' 'gt' 'idiv' 'if' 'import' 'insert' 'instance' 'intersect' 'into' 'is' 'item' 'last' 'le' 'let' 'lt' 'mod' 'modify' 'module' 'namespace' 'namespace-node' 'ne' 'node' 'only' 'or' 'order' 'ordered' 'parent' 'preceding' 'preceding-sibling' 'processing-instruction' 'rename' 'replace' 'return' 'satisfies' 'schema-attribute' 'schema-element' 'self' 'some' 'stable' 'start' 'switch' 'text' 'to' 'treat' 'try' 'typeswitch' 'union' 'unordered' 'validate' 'where' 'with' 'xquery' 'contains' 'paragraphs' 'sentences' 'times' 'words' 'by' 'collection' 'allowing' 'at' 'base-uri' 'boundary-space' 'break' 'catch' 'construction' 'context' 'continue' 'copy-namespaces' 'decimal-format' 'encoding' 'exit' 'external' 'ft-option' 'in' 'index' 'integrity' 'lax' 'nodes' 'option' 'ordering' 'revalidation' 'schema' 'score' 'sliding' 'strict' 'tumbling' 'type' 'updating' 'value' 'variable' 'version' 'while' 'constraint' 'loop' 'returning' 'append' 'array' 'json-item' 'object' 'structured-item'
- NCName^Token
- << 'after' 'and' 'as' 'ascending' 'before' 'case' 'cast' 'castable' 'collation' 'count' 'default' 'descending' 'div' 'else' 'empty' 'end' 'eq' 'except' 'for' 'ge' 'group' 'gt' 'idiv' 'instance' 'intersect' 'into' 'is' 'le' 'let' 'lt' 'mod' 'modify' 'ne' 'only' 'or' 'order' 'return' 'satisfies' 'stable' 'start' 'to' 'treat' 'union' 'where' 'with' 'contains' 'paragraphs' 'sentences' 'times' 'words' 'by' 'ancestor' 'ancestor-or-self' 'attribute' 'child' 'comment' 'copy' 'declare' 'delete' 'descendant' 'descendant-or-self' 'document' 'document-node' 'element' 'empty-sequence' 'every' 'first' 'following' 'following-sibling' 'function' 'if' 'import' 'insert' 'item' 'last' 'module' 'namespace' 'namespace-node' 'node' 'ordered' 'parent' 'preceding' 'preceding-sibling' 'processing-instruction' 'rename' 'replace' 'schema-attribute' 'schema-element' 'self' 'some' 'switch' 'text' 'try' 'typeswitch' 'unordered' 'validate' 'variable' 'xquery' 'allowing' 'at' 'base-uri' 'boundary-space' 'break' 'catch' 'construction' 'context' 'continue' 'copy-namespaces' 'decimal-format' 'encoding' 'exit' 'external' 'ft-option' 'in' 'index' 'integrity' 'lax' 'nodes' 'option' 'ordering' 'revalidation' 'schema' 'score' 'sliding' 'strict' 'tumbling' 'type' 'updating' 'value' 'version' 'while' 'constraint' 'loop' 'returning'
- <?ENCORE?>
- <?xqlint
- });
- ?>
|