XPath2 |
::= |
QueryList <EOF> |
QueryList |
::= |
Module ( <SemiColon> ( Module )? )* |
Module |
::= |
( MainModule | LibraryModule ) |
MainModule |
::= |
Prolog QueryBody |
LibraryModule |
::= |
ModuleDecl Prolog |
ModuleDecl |
::= |
<ModuleStringLit> |
Prolog |
::= |
( Version )? ( ( NamespaceDecl | XMLSpaceDecl | DefaultNamespaceDecl | DefaultCollationDecl | SchemaImport | ModuleImport | VarDefn | ValidationDecl ) )* ( FunctionDefn )* |
Version |
::= |
<VersionStringLiteral> |
ModuleImport |
::= |
<ImportModuleToken> ( <Namespace> <NCNameForPrefix> <AssignEquals> )? <URLLiteral> ( <AtStringLiteral> )? |
VarDefn |
::= |
<DefineVariable> <VarName> ( TypeDeclaration )? ( ( <LbraceExprEnclosure> Expr <Rbrace> ) | <External> ) |
QueryBody |
::= |
Expr |
Expr |
::= |
ExprSingle ( <Comma> ExprSingle )* |
ExprSingle |
::= |
( FLWORExpr | QuantifiedExpr | TypeswitchExpr | IfExpr | OrExpr ) |
FLWORExpr |
::= |
( ( ( ForClause | LetClause ) )+ ( WhereClause )? ( OrderByClause )? <Return> ExprSingle ) |
ForClause |
::= |
<ForVariable> <VarName> ( TypeDeclaration )? ( PositionalVar )? <In> ExprSingle ( <Comma> ( <VariableIndicator> <VarName> ( TypeDeclaration )? ( PositionalVar )? ) <In> ExprSingle )* |
PositionalVar |
::= |
<AtWord> <VariableIndicator> <VarName> |
LetClause |
::= |
<LetVariable> <VarName> ( TypeDeclaration )? <ColonEquals> ExprSingle ( <Comma> ( <VariableIndicator> <VarName> ( TypeDeclaration )? ) <ColonEquals> ExprSingle )* |
WhereClause |
::= |
<Where> Expr |
OrderByClause |
::= |
( <OrderBy> | <OrderByStable> ) OrderSpecList |
OrderSpecList |
::= |
OrderSpec ( <Comma> OrderSpec )* |
OrderSpec |
::= |
ExprSingle OrderModifier |
OrderModifier |
::= |
( ( <Ascending> | <Descending> ) )? ( ( <EmptyGreatest> | <EmptyLeast> ) )? ( <Collation> <StringLiteral> )? |
QuantifiedExpr |
::= |
( ( <Some> | <Every> ) <VarName> ( TypeDeclaration )? <In> ExprSingle ( <Comma> ( <VariableIndicator> <VarName> ( TypeDeclaration )? ) <In> ExprSingle )* <Satisfies> ExprSingle ) |
TypeswitchExpr |
::= |
( <TypeswitchLpar> Expr <Rpar> ( CaseClause )+ <Default> ( <VariableIndicator> <VarName> )? <Return> ExprSingle ) |
CaseClause |
::= |
<Case> ( <VariableIndicator> <VarName> <As> )? SequenceType <Return> Expr |
IfExpr |
::= |
( <IfLpar> Expr <Rpar> <Then> Expr <Else> ExprSingle ) |
OperatorExpr |
::= |
OrExpr |
OrExpr |
::= |
AndExpr ( <Or> AndExpr )* |
AndExpr |
::= |
InstanceofExpr ( <And> InstanceofExpr )* |
InstanceofExpr |
::= |
TreatExpr ( <Instanceof> SequenceType )? |
TreatExpr |
::= |
CastableExpr ( <TreatAs> SequenceType )? |
CastableExpr |
::= |
CastExpr ( <Castable> SingleType )? |
CastExpr |
::= |
ComparisonExpr ( <CastAs> SingleType )? |
ComparisonExpr |
::= |
RangeExpr ( ( ValueComp | GeneralComp | NodeComp | OrderComp ) RangeExpr )? |
RangeExpr |
::= |
AdditiveExpr ( <To> AdditiveExpr )? |
AdditiveExpr |
::= |
MultiplicativeExpr ( ( <Plus> | <Minus> ) MultiplicativeExpr )* |
MultiplicativeExpr |
::= |
UnaryExpr ( ( <Multiply> | <Div> | <Idiv> | <Mod> ) UnaryExpr )* |
UnaryExpr |
::= |
( <UnaryMinus> | <UnaryPlus> )* UnionExpr |
UnionExpr |
::= |
IntersectExceptExpr ( ( <Union> | <Vbar> ) IntersectExceptExpr )* |
IntersectExceptExpr |
::= |
ValueExpr ( ( <Intersect> | <Except> ) ValueExpr )* |
ValueExpr |
::= |
( ValidateExpr | PathExpr ) |
PathExpr |
::= |
( ( <Root> ( RelativePathExpr )? ) | ( <RootDescendants> RelativePathExpr ) | RelativePathExpr ) |
RelativePathExpr |
::= |
StepExpr ( ( <Slash> | <SlashSlash> ) StepExpr )* |
StepExpr |
::= |
( AxisStep | FilterStep ) |
AxisStep |
::= |
( ForwardStep | ReverseStep ) Predicates |
FilterStep |
::= |
PrimaryExpr Predicates |
PrimaryExpr |
::= |
( Literal | FunctionCall | ( <VariableIndicator> <VarName> ) | ParenthesizedExpr | Constructor ) |
Predicates |
::= |
( ( ( <Lbrack> Expr <Rbrack> ) ) )* |
ValidateExpr |
::= |
( <ValidateLbrace> | ( <ValidateGlobal> <LbraceExprEnclosure> ) | ( <ValidateContext> SchemaContextLocation <LbraceExprEnclosure> ) | ( <ValidateSchemaMode> ( SchemaContext )? <LbraceExprEnclosure> ) ) Expr <Rbrace> |
SchemaContext |
::= |
( ( <InContextForKindTest> SchemaContextLocation ) | <Global> ) |
Constructor |
::= |
( ElementConstructor | XmlComment | XmlProcessingInstruction | CdataSection | ComputedDocumentConstructor | ComputedElementConstructor | ComputedAttributeConstructor | ComputedTextConstructor ) |
GeneralComp |
::= |
( <Equals> | <NotEquals> | <Lt> | <LtEquals> | <Gt> | <GtEquals> ) |
ValueComp |
::= |
( <FortranEq> | <FortranNe> | <FortranLt> | <FortranLe> | <FortranGt> | <FortranGe> ) |
NodeComp |
::= |
( <Is> | <IsNot> ) |
OrderComp |
::= |
( <LtLt> | <GtGt> ) |
ForwardStep |
::= |
( ( ForwardAxis NodeTest ) | AbbreviatedForwardStep ) |
ReverseStep |
::= |
( ( ReverseAxis ( NodeTest ) ) | AbbreviatedReverseStep ) |
AbbreviatedForwardStep |
::= |
( <Dot> | ( <At> NameTest ) | NodeTest ) |
AbbreviatedReverseStep |
::= |
<DotDot> |
ForwardAxis |
::= |
( <AxisChild> | <AxisDescendant> | <AxisAttribute> | <AxisSelf> | <AxisDescendantOrSelf> ) |
ReverseAxis |
::= |
( <AxisParent> ) |
NodeTest |
::= |
( KindTest | NameTest ) |
NameTest |
::= |
( <QName> | Wildcard ) |
Wildcard |
::= |
( <Star> | <NCNameColonStar> | <StarColonNCName> ) |
Literal |
::= |
( NumericLiteral | <StringLiteral> ) |
NumericLiteral |
::= |
( <IntegerLiteral> | <DecimalLiteral> | <DoubleLiteral> ) |
ParenthesizedExpr |
::= |
<Lpar> ( Expr )? <Rpar> |
FunctionCall |
::= |
( <QNameLpar> ) ( ExprSingle ( <Comma> ExprSingle )* )? <Rpar> |
ElementConstructor |
::= |
( <StartTagOpenRoot> | <StartTagOpen> ) <TagQName> AttributeList ( <EmptyTagClose> | ( <StartTagClose> ( ElementContent )* <EndTagOpen> <TagQName> ( <S> )? <EndTagClose> ) ) |
ComputedDocumentConstructor |
::= |
( <DocumentLbrace> Expr <Rbrace> ) |
ComputedElementConstructor |
::= |
( <ElementQNameLbrace> | ( <ElementLbrace> Expr <Rbrace> <LbraceExprEnclosure> ) ) ( Expr )? <Rbrace> |
ComputedAttributeConstructor |
::= |
( <AttributeQNameLbrace> | ( <AttributeLbrace> Expr <Rbrace> <LbraceExprEnclosure> ) ) ( Expr )? <Rbrace> |
ComputedTextConstructor |
::= |
<TextLbrace> ( Expr )? <Rbrace> |
CdataSection |
::= |
<CdataSectionStart> ( <CDataSectionChar> )* <CdataSectionEnd> |
XmlProcessingInstruction |
::= |
<ProcessingInstructionStart> <PITarget> ( <PIContentChar> )* <ProcessingInstructionEnd> |
XmlComment |
::= |
<XmlCommentStart> ( <CommentContentChar> )* <XmlCommentEnd> |
ElementContent |
::= |
( <ElementContentChar> | <LCurlyBraceEscape> | <RCurlyBraceEscape> | ElementConstructor | EnclosedExpr | CdataSection | <CharRef> | <PredefinedEntityRef> | XmlComment | XmlProcessingInstruction ) |
AttributeList |
::= |
( <S> ( <TagQName> ( <S> )? <ValueIndicator> ( <S> )? AttributeValue )? )* |
AttributeValue |
::= |
( ( <OpenQuot> ( ( <EscapeQuot> | AttributeValueContent ) )* <CloseQuot> ) | ( <OpenApos> ( ( <EscapeApos> | AttributeValueContent ) )* <CloseApos> ) ) |
AttributeValueContent |
::= |
( <QuoteAttributeContentChar> | <AposAttributeContentChar> | <CharRef> | <LCurlyBraceEscape> | <RCurlyBraceEscape> | EnclosedExpr | <PredefinedEntityRef> ) |
EnclosedExpr |
::= |
( <Lbrace> | <LbraceExprEnclosure> ) Expr <Rbrace> |
XMLSpaceDecl |
::= |
<DeclareXMLSpace> <XMLSpaceEquals> ( <XMLSpacePreserve> | <XMLSpaceStrip> ) |
DefaultCollationDecl |
::= |
<DefaultCollationEquals> <URLLiteral> |
NamespaceDecl |
::= |
<DeclareNamespace> <NCNameForPrefix> <AssignEquals> <URLLiteral> |
DefaultNamespaceDecl |
::= |
( <DefaultElement> | <DefaultFunction> ) <Namespace> <AssignEquals> <URLLiteral> |
FunctionDefn |
::= |
<DefineFunction> <QNameLpar> ( ParamList )? ( <Rpar> | ( <RparAs> SequenceType ) ) ( EnclosedExpr | <External> ) |
ParamList |
::= |
Param ( <Comma> Param )* |
Param |
::= |
<VariableIndicator> <VarName> ( TypeDeclaration )? |
TypeDeclaration |
::= |
<As> SequenceType |
SingleType |
::= |
AtomicType ( <OccurrenceZeroOrOne> )? |
SequenceType |
::= |
( ( ItemType ( OccurrenceIndicator )? ) | <Empty> ) |
AtomicType |
::= |
<QNameForSequenceType> |
ItemType |
::= |
( AtomicType | KindTest | <Item> ) |
KindTest |
::= |
( DocumentTest | ElementTest | AttributeTest | ProcessingInstructionTest | CommentTest | TextTest | AnyKindTest ) |
ElementTest |
::= |
( <ElementType> | <ElementTypeForKindTest> ) ( ( ( SchemaContextPath LocalName ) | ( NodeName ( <CommaForKindTest> TypeName ( <Nillable> )? )? ) ) )? <RparForKindTest> |
AttributeTest |
::= |
( <AttributeType> | <AttributeTypeForKindTest> ) ( ( ( SchemaContextPath <At> LocalName ) | ( <At> NodeName ( <CommaForKindTest> TypeName )? ) ) )? <RparForKindTest> |
ProcessingInstructionTest |
::= |
( <ProcessingInstructionLpar> | <ProcessingInstructionLparForKindTest> ) ( <StringLiteralForKindTest> )? <RparForKindTest> |
DocumentTest |
::= |
( <DocumentLpar> | <DocumentLparForKindTest> ) ( ElementTest )? <RparForKindTest> |
CommentTest |
::= |
( <CommentLpar> | <CommentLparForKindTest> ) <RparForKindTest> |
TextTest |
::= |
( <TextLpar> | <TextLparForKindTest> ) <RparForKindTest> |
AnyKindTest |
::= |
( <NodeLpar> | <NodeLparForKindTest> ) <RparForKindTest> |
SchemaContextPath |
::= |
<SchemaGlobalContextSlash> ( <SchemaContextStepSlash> )* |
SchemaContextLocation |
::= |
( ( SchemaContextPath <QNameForItemType> ) | <SchemaGlobalTypeName> ) |
LocalName |
::= |
<QNameForItemType> |
NodeName |
::= |
( <QNameForItemType> | <AnyName> ) |
TypeName |
::= |
( <QNameForItemType> | <AnyName> ) |
OccurrenceIndicator |
::= |
( <OccurrenceZeroOrOne> | <OccurrenceZeroOrMore> | <OccurrenceOneOrMore> ) |
ValidationDecl |
::= |
( <DefaultSchemaModeLax> | <DefaultSchemaModeStrict> | <DefaultSchemaModeSkip> ) |
SchemaImport |
::= |
<ImportSchemaToken> ( SchemaPrefix )? <URLLiteral> ( <AtStringLiteral> )? |
SchemaPrefix |
::= |
( ( <Namespace> <NCNameForPrefix> <AssignEquals> ) | ( <DefaultElement> <Namespace> <AssignEquals> ) ) |