1 Introduction
2 Basics
2.1 Expression Context
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.1.1</st1:chsdate> Static Context
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.1.2</st1:chsdate> Dynamic Context
2.2 Processing Model
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.1</st1:chsdate> Data Model Generation
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.2</st1:chsdate> Schema Import Processing
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.3</st1:chsdate> Expression Processing
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.3</st1:chsdate>.1 Static Analysis Phase
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.3</st1:chsdate>.2 Dynamic Evaluation Phase
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.4</st1:chsdate> Serialization
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.2.5</st1:chsdate> Consistency Constraints
2.3 Error Handling
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.3.1</st1:chsdate> Kinds of Errors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.3.2</st1:chsdate> Identifying and Reporting Errors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.3.3</st1:chsdate> Handling Dynamic Errors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.3.4</st1:chsdate> Errors and Optimization
2.4 Concepts
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.4.1</st1:chsdate> Document Order
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.4.2</st1:chsdate> Atomization
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.4.3</st1:chsdate> Effective Boolean Value
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.4.4</st1:chsdate> Input Sources
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.4.5</st1:chsdate> URI Literals
2.5 Types
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.1</st1:chsdate> Predefined Schema Types
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.2</st1:chsdate> Typed Value and String Value
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.3</st1:chsdate> SequenceType Syntax
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate> SequenceType Matching
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate>.1 Matching a SequenceType and a Value
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate>.2 Matching an ItemType and an Item
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate>.3 Element Test
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate>.4 Schema Element Test
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate>.5 Attribute Test
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 2.5.4</st1:chsdate>.6 Schema Attribute Test
2.6 Comments
3 Expressions
3.1 Primary Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.1.1</st1:chsdate> Literals
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.1.2</st1:chsdate> Variable References
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.1.3</st1:chsdate> Parenthesized Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.1.4</st1:chsdate> Context Item Expression
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.1.5</st1:chsdate> Function Calls
3.2 Path Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.2.1</st1:chsdate> Steps
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.2.1</st1:chsdate>.1 Axes
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.2.1</st1:chsdate>.2 Node Tests
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.2.2</st1:chsdate> Predicates
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.2.3</st1:chsdate> Unabbreviated Syntax
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.2.4</st1:chsdate> Abbreviated Syntax
3.3 Sequence Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.3.1</st1:chsdate> Constructing Sequences
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.3.2</st1:chsdate> Filter Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.3.3</st1:chsdate> Combining Node Sequences
3.4 Arithmetic Expressions
3.5 Comparison Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.5.1</st1:chsdate> Value Comparisons
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.5.2</st1:chsdate> General Comparisons
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.5.3</st1:chsdate> Node Comparisons
3.6 Logical Expressions
3.7 Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.1</st1:chsdate> Direct Element Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.1</st1:chsdate>.1 Attributes
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.1</st1:chsdate>.2 Namespace Declaration Attributes
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.1</st1:chsdate>.3 Content
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.1</st1:chsdate>.4 Boundary Whitespace
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.2</st1:chsdate> Other Direct Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate> Computed Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate>.1 Computed Element Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate>.2 Computed Attribute Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate>.3 Document Node Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate>.4 Text Node Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate>.5 Computed Processing Instruction Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.3</st1:chsdate>.6 Computed Comment Constructors
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.7.4</st1:chsdate> In-scope Namespaces of a Constructed Element
3.8 FLWOR Expressions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.8.1</st1:chsdate> For and Let Clauses
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.8.2</st1:chsdate> Where Clause
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.8.3</st1:chsdate> Order By and Return Clauses
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.8.4</st1:chsdate> Example
3.9 Ordered and Unordered Expressions
3.10 Conditional Expressions
3.11 Quantified Expressions
3.12 Expressions on SequenceTypes
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.12.1</st1:chsdate> Instance Of
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.12.2</st1:chsdate> Typeswitch
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.12.3</st1:chsdate> Cast
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.12.4</st1:chsdate> Castable
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.12.5</st1:chsdate> Constructor Functions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 3.12.6</st1:chsdate> Treat
3.13 Validate Expressions
3.14 Extension Expressions
4 Modules and Prologs
4.1 Version Declaration
4.2 Module Declaration
4.3 Boundary-space Declaration
4.4 Default Collation Declaration
4.5 Base URI Declaration
4.6 Construction Declaration
4.7 Ordering Mode Declaration
4.8 Empty Order Declaration
4.9 Copy-Namespaces Declaration
4.10 Schema Import
4.11 Module Import
4.12 Namespace Declaration
4.13 Default Namespace Declaration
4.14 Variable Declaration
4.15 Function Declaration
4.16 Option Declaration
5 Conformance
5.1 Minimal Conformance
5.2 Optional Features
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.1</st1:chsdate> Schema Import Feature
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.2</st1:chsdate> Schema Validation Feature
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.3</st1:chsdate> Static Typing Feature
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.3</st1:chsdate>.1 Static Typing Extensions
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.4</st1:chsdate> Full Axis Feature
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.5</st1:chsdate> Module Feature
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> 5.2.6</st1:chsdate> Serialization Feature
5.3 Data Model Conformance
A XQuery Grammar
A.1 EBNF
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.1.1</st1:chsdate> Notation
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.1.2</st1:chsdate> Extra-grammatical Constraints
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.1.3</st1:chsdate> Grammar Notes
A.2 Lexical structure
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.1</st1:chsdate> Terminal Symbols
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.2</st1:chsdate> Terminal Delimitation
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.3</st1:chsdate> End-of-Line Handling
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.3.1</st1:chsdate> XML 1.0 End-of-Line Handling
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.3.2</st1:chsdate> XML 1.1 End-of-Line Handling
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.4</st1:chsdate> Whitespace Rules
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.4.1</st1:chsdate> Default Whitespace Handling
<st1:chsdate w:st="on" year="1899" isrocdate="False" day="30" islunardate="False" month="12"> A.2.4.2</st1:chsdate> Explicit Whitespace Handling
A.3 Reserved Function Names
A.4 Precedence Order
B Type Promotion and Operator Mapping
B.1 Type Promotion
B.2 Operator Mapping
C Context Components
C.1 Static Context Components
C.2 Dynamic Context Components
C.3 Serialization Parameters
D Implementation-Defined Items
E References
E.1 Normative References
E.2 Non-normative References
E.3 Background Material
F Error Conditions
G The application/xquery Media Type
G.1 Introduction
G.2 Registration of MIME Media Type application/xquery
G.2.1 Interoperability Considerations
G.2.2 Applications Using this Media Type
G.2.3 File Extensions
G.2.4 Intended Usage
G.2.5 Author/Change Controller
G.3 Encoding Considerations
G.4 Recognizing XQuery Files
G.5 Charset Default Rules
G.6 Security Considerations
H Glossary (Non-Normative)
I Example Applications (Non-Normative)
I.1 Joins
I.2 Grouping
I.3 Queries on Sequence
I.4 Recursive Transformations
I.5 Selecting Distinct Combinations
J Revision Log (Non-Normative)