| Chapter 1. Introduction to XQuery |
| What is XQuery? |
| Easing into XQuery |
| Path Expressions |
| FLWORs |
| Adding XML Elements and Attributes |
| Functions |
| Joins |
| Aggregating and Grouping Values |
|
| Chapter 2. XQuery Foundations |
| The Design of the XQuery Language |
| XQuery in Context |
| Processing Queries |
| The XQuery Data Model |
| Namespaces |
|
| Chapter 3. Expressions: XQuery Building Blocks |
| Categories of Expressions |
| Keywords and Names |
| Whitespace in Queries |
| Literals |
| Variables |
| Function Calls |
| Comments |
| Evaluation Order and Parentheses |
| Comparison Expressions |
| Conditional (if-then-else) Expressions |
| Logical (and/or) Expressions |
|
| Chapter 4. Navigating Input Documents Using Paths |
| Path Expressions |
| Predicates |
| Dynamic Paths |
| Input Documents |
| A Closer Look at Context |
|
| Chapter 5. Adding Elements and Attributes to Results |
| Including Elements and Attributes from the Input Document |
| Direct Element Constructors |
| Computed Constructors |
|
| Chapter 6. Selecting and Joining Using FLWORs |
| Selecting with Path Expressions |
| FLWOR Expressions |
| Quantified Expressions |
| Selecting Distinct Values |
| Joins |
|
| Chapter 7. Sorting and Grouping |
| Sorting in XQuery |
| Grouping |
| Aggregating Values |
|
| Chapter 8. Functions |
| Built-in Versus User-Defined Functions |
| Calling Functions |
| User-Defined Functions |
|
| Chapter 9. Advanced Queries |
| Copying Input Elements with Modifications |
| Working with Positions and Sequence Numbers |
| Combining Results |
| Using Intermediate XML Documents |
|
| Chapter 10. Namespaces and XQuery |
| XML Namespaces |
| Namespaces and XQuery |
| Namespace Declarations in Queries |
| Controlling Namespace Declarations in your Results |
|
| Chapter 11. A Closer Look at Types |
| The XQuery Type System |
| The Built-in Types |
| Types, Nodes and Atomic Values |
| Type Checking in XQuery |
| Automatic Type Conversions |
| Sequence Types |
| Constructors and Casting |
|
| Chapter 12. Queries, Prologs and Modules |
| Structure of a Query: Prolog and Body |
| Assembling Queries from Multiple Modules |
| Variable Declarations |
| Declaring External Functions |
|
| Chapter 13. Using Schemas with XQuery |
| What is a Schema? |
| Why Use Schemas with Queries? |
| W3C XML Schema: A Brief Overview |
| In-Scope Schema Definitions |
| Schema Validation and Type Assignment |
| Sequence Types and Schemas |
|
| Chapter 14. Static Typing |
| What is Static Typing? |
| The Typeswitch Expression |
| The Treat Expression |
| Type Declarations |
| The zero-or-one, one-or-more, and exactly-one Functions |
|
| Chapter 15. Principles of Query Design |
| Query Design Goals |
| Clarity |
| Modularity |
| Robustness |
| Error Handling |
| Performance |
|
| Chapter 16. Working with Numbers |
| The Numeric Types |
| Constructing Numeric Values |
| Comparing Numeric Values |
| Arithmetic Operations |
| Functions on Numbers |
|
| Chapter 17. Working with Strings |
| The xs:string Type |
| Constructing Strings |
| Comparing Strings |
| Substrings |
| Finding the Length of a String |
| Concatenating and Splitting Strings |
| Manipulating Strings |
| Whitespace and Strings |
| Internationalization Considerations |
|
| Chapter 18. Regular Expressions |
| The Structure of a Regular Expression |
| Representing Individual Characters |
| Representing Any Character |
| Representing Groups of Characters |
| Character Class Expressions |
| Reluctant Quantifiers |
| Anchors |
| Back-References |
| Using Flags |
| Using Sub-Expressions with Replacement Variables |
|
| Chapter 19. Working with Dates, Times and Durations |
| The Date and Time Types |
| The Duration Types |
| Extracting Components of Dates, Times and Durations |
| Using Arithmetic Operators on Dates, Times and Durations |
| The Date Component Types |
|
| Chapter 20. Working with Qualified Names, URIs and IDs |
| Working with Qualified Names |
| Working with URIs |
| Working with IDs |
|
| Chapter 21. Working with Other XML Components |
| XML Comments |
| Processing Instructions |
| Documents |
| Text Nodes |
| XML Entity and Character References |
| CDATA Sections |
|
| Chapter 22. Additional XQuery-Related Standards |
| Serialization |
| XQueryX |
| XQuery Update Facility |
| Full-Text Search |
| XQuery API for Java (XQJ) |
|
| Chapter 23. Implementation-Specific Features |
| Conformance |
| XML Version Support |
| Setting the Query Context |
| Option Declarations and Extension Expressions |
| Specifying Serialization Parameters |
|
| Chapter 24. XQuery for SQL Users |
| Relational Versus XML Data Models |
| Comparing SQL Syntax to XQuery Syntax |
| Combining SQL and XQuery |
| SQL/XML |
|
| Chapter 25. XQuery for XSLT Users |
| XQuery and XPath |
| XQuery Versus XSLT |
| Differences between XQuery 1.0/XPath 2.0 and XPath 1.0 |
|
| Appendix A. Built-in Function Reference |
|
| Appendix B. Built-in Type Reference |
|
| Appendix C. Error Code Reference |