XQuery

Book description

With the XQuery 1.0 standard, you finally have a tool that will make it much easier to search, extract and manipulate information from XML content stored in databases. This in-depth tutorial not only walks you through the XQuery specification, but also teaches you how to program with this widely anticipated query language.

XQuery is for query writers who have some knowledge of XML basics, but not necessarily advanced knowledge of XML-related technologies. It can be used both as a tutorial, by reading cover to cover, and as a reference, by using the comprehensive index and appendixes. Either way, you will find the background knowledge in namespaces, schemas, built-in types and regular expressions that is relevant to writing XML queries. This book provides:

  • A high-level overview and quick tour of XQuery

  • Information to write sophisticated queries, without being bogged down by the details of types, namespaces, and schemas

  • Advanced concepts for users who want to take advantage of modularity, namespaces, typing and schemas

  • Guidelines for working with specific types of data, such as numbers, strings, dates, URIs and processing instructions

  • A complete alphabetical reference to the built-in functions and types

You will also learn about XQuery's support for filtering, sorting, and grouping data, as well as how to use FLWOR expressions, XPath, and XQuery tools for extracting and combining information. With this book, you will discover how to apply all of these tools to a wide variety of data sources, and how to recombine information from multiple sources into a single final output result.

Whether you're coming from SQL, XSLT, or starting from scratch, this carefully paced tutorial takes you through the final 1.0 standard in detail.

Table of contents

  1. XQuery
    1. A Note Regarding Supplemental Files
    2. Preface
      1. Contents of This Book
      2. Reading the Syntax Diagrams
      3. Conventions Used in This Book
      4. Using Code Examples
      5. Useful Functions
      6. We'd Like to Hear from You
      7. Acknowledgments
    3. 1. Introduction to XQuery
      1. 1.1. What Is XQuery?
        1. 1.1.1. Capabilities of XQuery
        2. 1.1.2. Uses for XQuery
        3. 1.1.3. Processing Scenarios
      2. 1.2. Easing into XQuery
      3. 1.3. Path Expressions
      4. 1.4. FLWORs
      5. 1.5. Adding XML Elements and Attributes
        1. 1.5.1. Adding Elements
        2. 1.5.2. Adding Attributes
      6. 1.6. Functions
      7. 1.7. Joins
      8. 1.8. Aggregating and Grouping Values
    4. 2. XQuery Foundations
      1. 2.1. The Design of the XQuery Language
      2. 2.2. XQuery in Context
        1. 2.2.1. XQuery and XPath
        2. 2.2.2. XQuery Versus XSLT
        3. 2.2.3. XQuery Versus SQL
        4. 2.2.4. XQuery and XML Schema
      3. 2.3. Processing Queries
        1. 2.3.1. XML Input Documents
        2. 2.3.2. The Query
        3. 2.3.3. The Context
        4. 2.3.4. The Query Processor
        5. 2.3.5. The Results of the Query
      4. 2.4. The XQuery Data Model
        1. 2.4.1. Nodes
          1. 2.4.1.1. Node kinds
          2. 2.4.1.2. The node hierarchy
          3. 2.4.1.3. The node family
          4. 2.4.1.4. Roots, documents, and elements
          5. 2.4.1.5. Node identity and name
          6. 2.4.1.6. String and typed values of nodes
        2. 2.4.2. Atomic Values
        3. 2.4.3. Sequences
      5. 2.5. Types
      6. 2.6. Namespaces
    5. 3. Expressions: XQuery Building Blocks
      1. 3.1. Categories of Expressions
      2. 3.2. Keywords and Names
      3. 3.3. Whitespace in Queries
      4. 3.4. Literals
      5. 3.5. Variables
      6. 3.6. Function Calls
      7. 3.7. Comments
      8. 3.8. Evaluation Order and Parentheses
      9. 3.9. Comparison Expressions
        1. 3.9.1. General Comparisons
          1. 3.9.1.1. General comparisons on multi-item sequences
          2. 3.9.1.2. General comparisons and types
        2. 3.9.2. Value Comparisons
        3. 3.9.3. Node Comparisons
      10. 3.10. Conditional (if-then-else) Expressions
        1. 3.10.1. Conditional Expressions and Effective Boolean Values
        2. 3.10.2. Nesting Conditional Expressions
      11. 3.11. Logical (and/or) Expressions
        1. 3.11.1. Evaluation Order of Logical Expressions
        2. 3.11.2. Negating a Boolean Value
    6. 4. Navigating Input Documents Using Paths
      1. 4.1. Path Expressions
        1. 4.1.1. Path Expressions and Context
          1. 4.1.1.1. Steps and changing context
        2. 4.1.2. Steps
        3. 4.1.3. Axes
        4. 4.1.4. Node Tests
          1. 4.1.4.1. Node name tests
          2. 4.1.4.2. Node name tests and namespaces
          3. 4.1.4.3. Node name tests and wildcards
          4. 4.1.4.4. Node kind tests
        5. 4.1.5. Abbreviated Syntax
        6. 4.1.6. Other Expressions As Steps
      2. 4.2. Predicates
        1. 4.2.1. Comparisons in Predicates
        2. 4.2.2. Using Positions in Predicates
          1. 4.2.2.1. Understanding positional predicates
          2. 4.2.2.2. The position and last functions
          3. 4.2.2.3. Positional predicates and reverse axes
        3. 4.2.3. Using Multiple Predicates
        4. 4.2.4. More Complex Predicates
      3. 4.3. Dynamic Paths
      4. 4.4. Input Documents
        1. 4.4.1. Accessing a Single Document
        2. 4.4.2. Accessing a Collection
        3. 4.4.3. Setting the Context Node Outside the Query
        4. 4.4.4. Using Variables
      5. 4.5. A Closer Look at Context
        1. 4.5.1. Working with the Context Node
        2. 4.5.2. Accessing the Root
    7. 5. Adding Elements and Attributes to Results
      1. 5.1. Including Elements and Attributes from the Input Document
      2. 5.2. Direct Element Constructors
        1. 5.2.1. Containing Literal Characters
        2. 5.2.2. Containing Other Element Constructors
        3. 5.2.3. Containing Enclosed Expressions
          1. 5.2.3.1. Enclosed expressions that evaluate to elements
          2. 5.2.3.2. Enclosed expressions that evaluate to attributes
          3. 5.2.3.3. Enclosed expressions that evaluate to atomic values
          4. 5.2.3.4. Enclosed expressions with multiple subexpressions
        4. 5.2.4. Specifying Attributes Directly
        5. 5.2.5. Declaring Namespaces in Direct Constructors
        6. 5.2.6. Use Case: Modifying an Element from the Input Document
        7. 5.2.7. Direct Element Constructors and Whitespace
          1. 5.2.7.1. Boundary whitespace
          2. 5.2.7.2. The boundary-space declaration
          3. 5.2.7.3. Forcing boundary whitespace preservation
      3. 5.3. Computed Constructors
        1. 5.3.1. Computed Element Constructors
          1. 5.3.1.1. Names of computed element constructors
          2. 5.3.1.2. Content of computed element constructors
        2. 5.3.2. Computed Attribute Constructors
        3. 5.3.3. Use Case: Turning Content to Markup
    8. 6. Selecting and Joining Using FLWORs
      1. 6.1. Selecting with Path Expressions
      2. 6.2. FLWOR Expressions
        1. 6.2.1. The for Clause
          1. 6.2.1.1. Range expressions
          2. 6.2.1.2. Multiple for clauses
        2. 6.2.2. The let Clause
        3. 6.2.3. The where Clause
        4. 6.2.4. The return Clause
        5. 6.2.5. The Scope of Variables
      3. 6.3. Quantified Expressions
        1. 6.3.1. Binding Multiple Variables
      4. 6.4. Selecting Distinct Values
      5. 6.5. Joins
        1. 6.5.1. Three-Way Joins
        2. 6.5.2. Outer Joins
        3. 6.5.3. Joins and Types
    9. 7. Sorting and Grouping
      1. 7.1. Sorting in XQuery
        1. 7.1.1. The order by Clause
          1. 7.1.1.1. Using multiple ordering specifications
          2. 7.1.1.2. Sorting and types
          3. 7.1.1.3. Order modifiers
          4. 7.1.1.4. Empty order
          5. 7.1.1.5. Stable ordering
          6. 7.1.1.6. More complex order specifications
        2. 7.1.2. Document Order
          1. 7.1.2.1. Document order defined
          2. 7.1.2.2. Sorting in document order
          3. 7.1.2.3. Inadvertent resorting in document order
        3. 7.1.3. Order Comparisons
        4. 7.1.4. Reversing the Order
        5. 7.1.5. Indicating That Order Is Not Significant
          1. 7.1.5.1. The unordered function
          2. 7.1.5.2. The unordered expression
          3. 7.1.5.3. The ordering mode declaration
      2. 7.2. Grouping
      3. 7.3. Aggregating Values
        1. 7.3.1. Ignoring "Missing" Values
        2. 7.3.2. Counting "Missing" Values
        3. 7.3.3. Aggregating on Multiple Values
        4. 7.3.4. Constraining and Sorting on Aggregated Values
    10. 8. Functions
      1. 8.1. Built-in Versus User-Defined Functions
      2. 8.2. Calling Functions
        1. 8.2.1. Function Names
        2. 8.2.2. Function Signatures
        3. 8.2.3. Argument Lists
          1. 8.2.3.1. Argument lists and the empty sequence
          2. 8.2.3.2. Argument lists and sequences
        4. 8.2.4. Sequence Types
      3. 8.3. User-Defined Functions
        1. 8.3.1. Why Define Your Own Functions?
        2. 8.3.2. Function Declarations
        3. 8.3.3. The Function Body
        4. 8.3.4. The Function Name
        5. 8.3.5. The Parameter List
          1. 8.3.5.1. Accepting arguments that are nodes versus atomic values
          2. 8.3.5.2. Accepting arguments that are the empty sequence
        6. 8.3.6. Functions and Context
        7. 8.3.7. Recursive Functions
    11. 9. Advanced Queries
      1. 9.1. Copying Input Elements with Modifications
        1. 9.1.1. Adding Attributes to an Element
        2. 9.1.2. Removing Attributes from an Element
        3. 9.1.3. Removing Attributes from All Descendants
        4. 9.1.4. Removing Child Elements
        5. 9.1.5. Changing Names
      2. 9.2. Working with Positions and Sequence Numbers
        1. 9.2.1. Adding Sequence Numbers to Results
        2. 9.2.2. Testing for the Last Item
      3. 9.3. Combining Results
        1. 9.3.1. Sequence Constructors
        2. 9.3.2. The union Expression
        3. 9.3.3. The intersect Expression
        4. 9.3.4. The except Expression
      4. 9.4. Using Intermediate XML Documents
        1. 9.4.1. Creating Lookup Tables
        2. 9.4.2. Reducing Complexity
    12. 10. Namespaces and XQuery
      1. 10.1. XML Namespaces
        1. 10.1.1. Namespace URIs
        2. 10.1.2. Declaring Namespaces
        3. 10.1.3. Default Namespace Declarations
        4. 10.1.4. Namespaces and Attributes
        5. 10.1.5. Namespace Declarations and Scope
      2. 10.2. Namespaces and XQuery
      3. 10.3. Namespace Declarations in Queries
        1. 10.3.1. Predeclared Namespaces
        2. 10.3.2. Prolog Namespace Declarations
          1. 10.3.2.1. Default namespace declarations in the prolog
          2. 10.3.2.2. The default function namespace declaration
          3. 10.3.2.3. Other prolog namespace declarations
        3. 10.3.3. Namespace Declarations in Element Constructors
        4. 10.3.4. The Impact and Scope of Namespace Declarations
          1. 10.3.4.1. Scope of namespace declarations
          2. 10.3.4.2. Names affected by namespace declarations
          3. 10.3.4.3. Namespace declarations and input elements
      4. 10.4. Controlling Namespace Declarations in Your Results
        1. 10.4.1. In-Scope Versus Statically Known Namespaces
        2. 10.4.2. Controlling the Copying of Namespace Declarations
    13. 11. A Closer Look at Types
      1. 11.1. The XQuery Type System
        1. 11.1.1. Advantages of a Strong Type System
        2. 11.1.2. Do You Need to Care About Types?
      2. 11.2. The Built-in Types
      3. 11.3. Types, Nodes, and Atomic Values
        1. 11.3.1. Nodes and Types
        2. 11.3.2. Atomic Values and Types
      4. 11.4. Type Checking in XQuery
        1. 11.4.1. The Static Analysis Phase
        2. 11.4.2. The Dynamic Evaluation Phase
      5. 11.5. Automatic Type Conversions
        1. 11.5.1. Subtype Substitution
        2. 11.5.2. Type Promotion
        3. 11.5.3. Casting of Untyped Values
        4. 11.5.4. Atomization
        5. 11.5.5. Effective Boolean Value
        6. 11.5.6. Function Conversion Rules
      6. 11.6. Sequence Types
        1. 11.6.1. Occurrence Indicators
        2. 11.6.2. Generic Sequence Types
        3. 11.6.3. Atomic Type Names As Sequence Types
        4. 11.6.4. Element and Attribute Tests
        5. 11.6.5. Sequence Type Matching
        6. 11.6.6. The "instance of" Expression
      7. 11.7. Constructors and Casting
        1. 11.7.1. Constructors
        2. 11.7.2. The Cast Expression
        3. 11.7.3. The Castable Expression
        4. 11.7.4. Casting Rules
          1. 11.7.4.1. Casting among the primitive types
          2. 11.7.4.2. Casting to xs:string or xs:untypedAtomic
          3. 11.7.4.3. Casting to xs:string or xs:untypedAtomic
          4. 11.7.4.4. Casting among derived types
    14. 12. Queries, Prologs, and Modules
      1. 12.1. Structure of a Query: Prolog and Body
        1. 12.1.1. Prolog Declarations
        2. 12.1.2. The Version Declaration
      2. 12.2. Assembling Queries from Multiple Modules
        1. 12.2.1. Library Modules
        2. 12.2.2. Importing a Library Module
          1. 12.2.2.1. Multiple module imports
          2. 12.2.2.2. The behavior of a module import
      3. 12.3. Variable Declarations
        1. 12.3.1. Variable Declaration Syntax
        2. 12.3.2. The Scope of Variables
        3. 12.3.3. Variable Names
        4. 12.3.4. Initializing Expressions
        5. 12.3.5. External Variables
      4. 12.4. Declaring External Functions
    15. 13. Using Schemas with XQuery
      1. 13.1. What Is a Schema?
      2. 13.2. Why Use Schemas with Queries?
      3. 13.3. W3C XML Schema: A Brief Overview
        1. 13.3.1. Element and Attribute Declarations
        2. 13.3.2. Types
          1. 13.3.2.1. Simple and complex types
          2. 13.3.2.2. User-defined types
          3. 13.3.2.3. List types
        3. 13.3.3. Namespaces and XML Schema
      4. 13.4. In-Scope Schema Definitions
        1. 13.4.1. Where Do In-Scope Schema Definitions Come from?
        2. 13.4.2. Schema Imports
          1. 13.4.2.1. Importing a schema with no target namespace
          2. 13.4.2.2. Importing multiple schemas with the same target namespace
          3. 13.4.2.3. Schema imports and library modules
      5. 13.5. Schema Validation and Type Assignment
        1. 13.5.1. The Validate Expression
        2. 13.5.2. Validation Mode
        3. 13.5.3. Assigning Type Annotations to Nodes
        4. 13.5.4. Nodes and Typed Values
        5. 13.5.5. Types and Newly Constructed Elements and Attributes
      6. 13.6. Sequence Types and Schemas
    16. 14. Static Typing
      1. 14.1. What Is Static Typing?
        1. 14.1.1. Obvious Static Type Errors
        2. 14.1.2. Static Typing and Schemas
        3. 14.1.3. Raising "False" Errors
        4. 14.1.4. Static Typing Expressions and Constructs
      2. 14.2. The Typeswitch Expression
      3. 14.3. The Treat Expression
      4. 14.4. Type Declarations
        1. 14.4.1. Type Declarations in FLWORs
        2. 14.4.2. Type Declarations in Quantified Expressions
        3. 14.4.3. Type Declarations in Global Variable Declarations
      5. 14.5. The zero-or-one, one-or-more, and exactly-one Functions
    17. 15. Principles of Query Design
      1. 15.1. Query Design Goals
      2. 15.2. Clarity
        1. 15.2.1. Improving the Layout
        2. 15.2.2. Choosing Names
        3. 15.2.3. Using Comments for Documentation
      3. 15.3. Modularity
      4. 15.4. Robustness
        1. 15.4.1. Handling Data Variations
        2. 15.4.2. Handling Missing Values
          1. 15.4.2.1. Absent values
          2. 15.4.2.2. Empty and nil values
          3. 15.4.2.3. Default "missing" values
      5. 15.5. Error Handling
        1. 15.5.1. Avoiding Dynamic Errors
        2. 15.5.2. The error and trace Functions
      6. 15.6. Performance
        1. 15.6.1. Avoid Reevaluating the Same or Similar Expressions
        2. 15.6.2. Avoid Unnecessary Sorting
        3. 15.6.3. Avoid Expensive Path Expressions
        4. 15.6.4. Use Predicates Instead of where Clauses
    18. 16. Working with Numbers
      1. 16.1. The Numeric Types
        1. 16.1.1. The xs:decimal Type
        2. 16.1.2. The xs:integer Type
        3. 16.1.3. The xs:float and xs:double Types
      2. 16.2. Constructing Numeric Values
        1. 16.2.1. The number Function
        2. 16.2.2. Numeric Type Promotion
      3. 16.3. Comparing Numeric Values
      4. 16.4. Arithmetic Operations
        1. 16.4.1. Arithmetic Operations on Multiple Values
        2. 16.4.2. Arithmetic Operations and Types
        3. 16.4.3. Precedence of Arithmetic Operators
        4. 16.4.4. Addition, Subtraction, and Multiplication
        5. 16.4.5. Division
        6. 16.4.6. Modulus (Remainder)
      5. 16.5. Functions on Numbers
    19. 17. Working with Strings
      1. 17.1. The xs:string Type
      2. 17.2. Constructing Strings
        1. 17.2.1. String Literals
        2. 17.2.2. The xs:string Constructor and the string Function
      3. 17.3. Comparing Strings
        1. 17.3.1. Comparing Entire Strings
        2. 17.3.2. Determining Whether a String Contains Another String
        3. 17.3.3. Matching a String to a Pattern
      4. 17.4. Substrings
      5. 17.5. Finding the Length of a String
      6. 17.6. Concatenating and Splitting Strings
        1. 17.6.1. Concatenating Strings
        2. 17.6.2. Splitting Strings Apart
        3. 17.6.3. Converting Between Code Points and Strings
      7. 17.7. Manipulating Strings
        1. 17.7.1. Converting Between Uppercase and Lowercase
        2. 17.7.2. Replacing Individual Characters in Strings
        3. 17.7.3. Replacing Substrings That Match a Pattern
      8. 17.8. Whitespace and Strings
        1. 17.8.1. Normalizing Whitespace
      9. 17.9. Internationalization Considerations
        1. 17.9.1. Collations
        2. 17.9.2. Unicode Normalization
        3. 17.9.3. Determining the Language of an Element
    20. 18. Regular Expressions
      1. 18.1. The Structure of a Regular Expression
        1. 18.1.1. Atoms
        2. 18.1.2. Quantifiers
        3. 18.1.3. Parenthesized Sub-Expressions and Branches
      2. 18.2. Representing Individual Characters
      3. 18.3. Representing Any Character
      4. 18.4. Representing Groups of Characters
        1. 18.4.1. Multi-Character Escapes
        2. 18.4.2. Category Escapes
        3. 18.4.3. Block Escapes
      5. 18.5. Character Class Expressions
        1. 18.5.1. Single Characters and Ranges
        2. 18.5.2. Subtraction from a Range
        3. 18.5.3. Negative Character Class Expressions
        4. 18.5.4. Escaping Rules for Character Class Expressions
      6. 18.6. Reluctant Quantifiers
      7. 18.7. Anchors
        1. 18.7.1. Anchors and Multi-Line Mode
      8. 18.8. Back-References
      9. 18.9. Using Flags
      10. 18.10. Using Sub-Expressions with Replacement Variables
    21. 19. Working with Dates, Times, and Durations
      1. 19.1. The Date and Time Types
        1. 19.1.1. Constructing and Casting Dates and Times
        2. 19.1.2. Time Zones
          1. 19.1.2.1. Explicit versus implicit time zones
          2. 19.1.2.2. Adjusting time zones
          3. 19.1.2.3. Finding the time zone of a value
        3. 19.1.3. Comparing Dates and Times
      2. 19.2. The Duration Types
        1. 19.2.1. The yearMonthDuration and dayTimeDuration Types
        2. 19.2.2. Comparing Durations
      3. 19.3. Extracting Components of Dates, Times, and Durations
      4. 19.4. Using Arithmetic Operators on Dates, Times, and Durations
        1. 19.4.1. Subtracting Dates and Times
        2. 19.4.2. Adding and Subtracting Durations from Dates and Times
        3. 19.4.3. Adding and Subtracting Two Durations
        4. 19.4.4. Multiplying and Dividing Durations by Numbers
        5. 19.4.5. Dividing Durations by Durations
      5. 19.5. The Date Component Types
    22. 20. Working with Qualified Names, URIs, and IDs
      1. 20.1. Working with Qualified Names
        1. 20.1.1. Retrieving Node Names
        2. 20.1.2. Constructing Qualified Names
        3. 20.1.3. Other Name-Related Functions
      2. 20.2. Working with URIs
        1. 20.2.1. Base and Relative URIs
          1. 20.2.1.1. Using the xml:base attribute
          2. 20.2.1.2. Finding the base URI of a node
          3. 20.2.1.3. Resolving URIs
          4. 20.2.1.4. The base URI of the static context
        2. 20.2.2. Documents and URIs
          1. 20.2.2.1. Finding the URI of a document
          2. 20.2.2.2. Opening a document from a dynamic value
        3. 20.2.3. Escaping URIs
      3. 20.3. Working with IDs
        1. 20.3.1. Joining IDs and IDREFs
        2. 20.3.2. Constructing IDs
    23. 21. Working with Other XML Components
      1. 21.1. XML Comments
        1. 21.1.1. XML Comments and the Data Model
        2. 21.1.2. Querying Comments
        3. 21.1.3. Comments and Sequence Types
        4. 21.1.4. Constructing Comments
      2. 21.2. Processing Instructions
        1. 21.2.1. Processing Instructions and the Data Model
        2. 21.2.2. Querying Processing Instructions
        3. 21.2.3. Processing Instructions and Sequence Types
        4. 21.2.4. Constructing Processing Instructions
      3. 21.3. Documents
        1. 21.3.1. Document Nodes and the Data Model
        2. 21.3.2. Document Nodes and Sequence Types
        3. 21.3.3. Constructing Document Nodes
      4. 21.4. Text Nodes
        1. 21.4.1. Text Nodes and the Data Model
        2. 21.4.2. Querying Text Nodes
        3. 21.4.3. Text Nodes and Sequence Types
        4. 21.4.4. Why Work with Text Nodes?
        5. 21.4.5. Constructing Text Nodes
      5. 21.5. XML Entity and Character References
      6. 21.6. CDATA Sections
    24. 22. Additional XQuery-Related Standards
      1. 22.1. Serialization
      2. 22.2. XQueryX
      3. 22.3. XQuery Update Facility
      4. 22.4. Full-Text Search
      5. 22.5. XQuery API for Java (XQJ)
    25. 23. Implementation-Specific Features
      1. 23.1. Conformance
      2. 23.2. XML Version Support
      3. 23.3. Setting the Query Context
      4. 23.4. Option Declarations and Extension Expressions
        1. 23.4.1. The Option Declaration
        2. 23.4.2. Extension Expressions
      5. 23.5. Specifying Serialization Parameters
    26. 24. XQuery for SQL Users
      1. 24.1. Relational Versus XML Data Models
      2. 24.2. Comparing SQL Syntax with XQuery Syntax
        1. 24.2.1. A Simple Query
        2. 24.2.2. Conditions and Operators
          1. 24.2.2.1. Comparisons
          2. 24.2.2.2. Arithmetic and string operators
          3. 24.2.2.3. Boolean operators
        3. 24.2.3. Functions
        4. 24.2.4. Selecting Distinct Values
        5. 24.2.5. Working with Multiple Tables and Subqueries
          1. 24.2.5.1. Subselects
          2. 24.2.5.2. Combining queries using set operators
        6. 24.2.6. Grouping
      3. 24.3. Combining SQL and XQuery
        1. 24.3.1. Combining Structured and Semistructured Data
        2. 24.3.2. Flexible Data Structures
      4. 24.4. SQL/XML
    27. 25. XQuery for XSLT Users
      1. 25.1. XQuery and XPath
      2. 25.2. XQuery Versus XSLT
        1. 25.2.1. Shared Components
        2. 25.2.2. Equivalent Components
        3. 25.2.3. Differences
          1. 25.2.3.1. Paradigm differences: push versus pull
          2. 25.2.3.2. Optimization for particular use cases
          3. 25.2.3.3. Convenient features of XSLT
      3. 25.3. Differences Between XQuery 1.0/XPath 2.0 and XPath 1.0
        1. 25.3.1. Data Model
        2. 25.3.2. New Expressions
        3. 25.3.3. Path Expressions
        4. 25.3.4. Function Conversion Rules
        5. 25.3.5. Arithmetic and Comparison Expressions
        6. 25.3.6. Built-in Functions
    28. A. Built-in Function Reference
    29. B. Built-in Types
      1. B.1. xs:anyAtomicType
      2. B.2. xs:anyType
      3. B.3. xs:anyURI
        1. B.3.1. Casting and Comparing xs:anyURI Values
      4. B.4. xs:base64Binary
      5. B.5. xs:boolean
        1. B.5.1. Constructing xs:boolean Values
        2. B.5.2. Casting xs:boolean Values
      6. B.6. xs:byte
      7. B.7. xs:date
      8. B.8. xs:dateTime
      9. B.9. xs:dayTimeDuration
      10. B.10. xs:decimal
        1. B.10.1. Casting xs:decimal Values
      11. B.11. xs:double
        1. B.11.1. Casting xs:double Values
      12. B.12. xs:duration
      13. B.13. xs:ENTITIES
      14. B.14. xs:ENTITY
      15. B.15. xs:float
        1. B.15.1. Casting xs:float Values
      16. B.16. xs:gDay
      17. B.17. xs:gMonth
      18. B.18. xs:gMonthDay
      19. B.19. xs:gYear
      20. B.20. xs:gYearMonth
      21. B.21. xs:hexBinary
        1. B.21.1. Casting and Comparing xs:hexBinary Values
      22. B.22. xs:ID
      23. B.23. xs:IDREF
      24. B.24. xs:IDREFS
      25. B.25. xs:int
      26. B.26. xs:integer
        1. B.26.1. Casting xs:integer Values
      27. B.27. xs:language
      28. B.28. xs:long
      29. B.29. xs:Name
      30. B.30. xs:NCName
      31. B.31. xs:negativeInteger
      32. B.32. xs:NMTOKEN
      33. B.33. xs:NMTOKENS
      34. B.34. xs:nonNegativeInteger
      35. B.35. xs:nonPositiveInteger
      36. B.36. xs:normalizedString
      37. B.37. xs:NOTATION
      38. B.38. xs:positiveInteger
      39. B.39. xs:QName
      40. B.40. xs:short
      41. B.41. xs:string
      42. B.42. xs:time
      43. B.43. xs:token
      44. B.44. xs:unsignedByte
      45. B.45. xs:unsignedInt
      46. B.46. xs:unsignedLong
      47. B.47. xs:unsignedShort
      48. B.48. xs:untyped
      49. B.49. xs:untypedAtomic
      50. B.50. xs:yearMonthDuration
    30. C. Error Summary
      1. C.1. FOAR0001
      2. C.2. FOAR0002
      3. C.3. FOCA0001
      4. C.4. FOCA0002
      5. C.5. FOCA0003
      6. C.6. FOCA0005
      7. C.7. FOCA0006
      8. C.8. FOCH0001
      9. C.9. FOCH0002
      10. C.10. FOCH0003
      11. C.11. FOCH0004
      12. C.12. FODC0001
      13. C.13. FODC0002
      14. C.14. FODC0003
      15. C.15. FODC0004
      16. C.16. FODC0005
      17. C.17. FODT0001
      18. C.18. FODT0002
      19. C.19. FODT0003
      20. C.20. FOER0000
      21. C.21. FONS0004
      22. C.22. FONS0005
      23. C.23. FORG0001
      24. C.24. FORG0002
      25. C.25. FORG0003
      26. C.26. FORG0004
      27. C.27. FORG0005
      28. C.28. FORG0006
      29. C.29. FORG0008
      30. C.30. FORG0009
      31. C.31. FORX0001
      32. C.32. FORX0002
      33. C.33. FORX0003
      34. C.34. FORX0004
      35. C.35. FOTY0012
      36. C.36. SENR0001
      37. C.37. SEPM0004
      38. C.38. SEPM0009
      39. C.39. SEPM0010
      40. C.40. SEPM0016
      41. C.41. SERE0003
      42. C.42. SERE0005
      43. C.43. SERE0006
      44. C.44. SERE0008
      45. C.45. SERE0012
      46. C.46. SERE0014
      47. C.47. SERE0015
      48. C.48. SESU0007
      49. C.49. SESU0011
      50. C.50. SESU0013
      51. C.51. XPDY0002
      52. C.52. XPDY0050
      53. C.53. XPST0001
      54. C.54. XPST0003
      55. C.55. XPST0005
      56. C.56. XPST0008
      57. C.57. XPST0010
      58. C.58. XPST0017
      59. C.59. XPST0051
      60. C.60. XPST0080
      61. C.61. XPST0081
      62. C.62. XPTY0004
      63. C.63. XPTY0018
      64. C.64. XPTY0019
      65. C.65. XPTY0020
      66. C.66. XQDY0025
      67. C.67. XQDY0026
      68. C.68. XQDY0027
      69. C.69. XQDY0041
      70. C.70. XQDY0044
      71. C.71. XQDY0061
      72. C.72. XQDY0064
      73. C.73. XQDY0072
      74. C.74. XQDY0074
      75. C.75. XQDY0084
      76. C.76. XQDY0091
      77. C.77. XQDY0092
      78. C.78. XQST0009
      79. C.79. XQST0012
      80. C.80. XQST0013
      81. C.81. XQST0016
      82. C.82. XQST0022
      83. C.83. XQST0031
      84. C.84. XQST0032
      85. C.85. XQST0033
      86. C.86. XQST0034
      87. C.87. XQST0035
      88. C.88. XQST0036
      89. C.89. XQST0038
      90. C.90. XQST0039
      91. C.91. XQST0040
      92. C.92. XQST0045
      93. C.93. XQST0046
      94. C.94. XQST0047
      95. C.95. XQST0048
      96. C.96. XQST0049
      97. C.97. XQST0054
      98. C.98. XQST0055
      99. C.99. XQST0057
      100. C.100. XQST0058
      101. C.101. XQST0059
      102. C.102. XQST0060
      103. C.103. XQST0065
      104. C.104. XQST0066
      105. C.105. XQST0067
      106. C.106. XQST0068
      107. C.107. XQST0069
      108. C.108. XQST0070
      109. C.109. XQST0071
      110. C.110. XQST0073
      111. C.111. XQST0075
      112. C.112. XQST0076
      113. C.113. XQST0079
      114. C.114. XQST0085
      115. C.115. XQST0087
      116. C.116. XQST0088
      117. C.117. XQST0089
      118. C.118. XQST0090
      119. C.119. XQST0093
      120. C.120. XQTY0024
      121. C.121. XQTY0030
      122. C.122. XQTY0086
    31. Index
    32. Index
    33. Colophon

Product information

  • Title: XQuery
  • Author(s):
  • Release date: March 2007
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596006341