Home Page Icon
Home Page
Table of Contents for
I. Foundations
Close
I. Foundations
by Michael Brundage
XQuery: The XML Query Language
Copyright
Dedication
Praise for XQuery
List of Figures
Foreword
Preface
Who Should Read This Book?
Organization
Resources
Acknowledgments
I. Foundations
1. A Tour of XQuery
1.1. Introduction
1.2. Getting Started
1.3. Notational Conventions
1.4. Why XQuery?
1.4.1. Query Languages Versus Programming Languages
1.4.2. XQuery Versus XPath, XSLT, and SQL
1.5. Documents and Databases
1.6. Typed and Untyped Data
1.6.1. XML Schema Redux
1.6.2. The Types You Need
1.6.3. The Types You Don't Need
1.7. A Sample Query
1.8. Processing Model
1.9. Comments and Whitespace
1.10. Prolog
1.11. Constants
1.11.1. Boolean Constants
1.11.2. String Constants
1.11.3. Numeric Constants
1.11.4. Other Constants
1.12. XML
1.13. Built-in Functions
1.14. Operators
1.14.1. Logic Operators
1.14.2. Arithmetic Operators
1.14.3. Text Operators
1.14.4. Comparison Operators
1.15. Paths
1.16. Variables
1.17. FLWOR
1.18. Error Handling
1.19. Conclusion
1.20. Further Reading
2. Data Model and Type System
2.1. Introduction
2.2. An Overview of XML Data Models
2.2.1. Two Examples
2.2.2. The Document Object Model (DOM)
2.2.3. The XPath 1.0 Data Model
2.2.4. The XML Information Set (Infoset)
2.2.5. The Post-Schema-Validation Infoset (PSVI)
2.2.6. The XQuery Data Model
2.3. Structure of the XQuery Data Model
2.3.1. Items and Sequences
2.3.2. Atomic Values
2.3.3. Nodes
2.4. Atomic Types
2.4.1. Untyped Data
2.4.2. Boolean Types
2.4.3. Numeric Types
2.4.3.1. Numerics Background
2.4.3.2. XQuery Numeric Types
2.4.4. String Types
2.4.5. Calendar Types
2.4.6. Qualified Name Type
2.4.7. Other Types
2.5. Node Kinds
2.5.1. Kind, Identity, and Order
2.5.2. Hierarchy
2.5.3. Node Name
2.5.4. Node Type and Values
2.5.5. Other Node Properties
2.6. Common Type Conversions
2.6.1. Atomization
2.6.2. Effective Boolean Value
2.6.3. Sequence Type Matching
2.6.3.1. Type Matching Algorithm
2.6.4. Subtype Substitution
2.6.5. Numeric Type Promotion
2.7. Conclusion
2.8. Further Reading
3. Navigation
3.1. Introduction
3.2. Paths
3.2.1. Beginnings
3.2.2. Axes
3.2.3. Node Tests
3.2.3.1. Name Tests
3.2.3.2. Node Kind Tests
3.2.3.3. Wildcards
3.2.4. Other Axes
3.2.5. Predicates
3.2.5.1. Numeric Predicates
3.2.5.2. Boolean Predicates
3.2.5.3. Successive and Nested Predicates
3.3. Navigation Functions
3.4. Navigation Context
3.4.1. Input Sequence
3.4.2. Focus
3.4.3. Variable Declarations
3.4.4. Namespace Declarations
3.4.5. Function Declarations
3.4.6. Collations
3.5. Navigation Examples
3.6. Navigation Complexities
3.6.1. Namespaces
3.6.2. Node Identity
3.6.3. Other Context Information
3.7. Conclusion
3.8. Further Reading
4. Functions and Modules
4.1. Introduction
4.2. Built-in Function Library
4.3. Function Invocation
4.4. Function Conversion Rules
4.5. User-Defined Functions
4.6. Recursion
4.7. External Functions
4.8. Modules
4.9. Conclusion
II. Core Language Features
5. Basic Expressions
5.1. Introduction
5.2. Comparisons
5.2.1. Value Comparisons
5.2.2. General Comparisons
5.2.3. Node Comparisons
5.2.4. Sequence and Tree Comparisons
5.3. Sequences
5.3.1. Constructing Sequences
5.3.2. Processing Sequences
5.4. Arithmetic
5.5. Logic
5.6. Query Prolog
5.6.1. Version Declaration
5.6.2. XML Space Declaration
5.6.3. Base URI Declaration
5.6.4. Default Collation Declaration
5.6.5. Namespace Declarations
5.6.6. Global Variable Declarations
5.6.7. Module Imports and Declaration
5.6.8. Schema Imports and Validation Declaration
5.7. Conclusion
5.8. Further Reading
6. Iteration
6.1. Introduction
6.2. FLWOR
6.2.1. Compared to SQL
6.2.2. Compared to XSLT
6.2.3. Introducing Variables
6.2.4. Tuples
6.3. Quantification
6.4. Joins
6.5. Comparing Sequences
6.5.1. Existential Comparison
6.5.2. Memberwise Comparison
6.5.3. Universal Comparison
6.6. Sorting
6.7. Grouping
6.8. Conclusion
6.9. Further Reading
7. Constructing XML
7.1. Introduction
7.2. Element Nodes
7.2.1. Direct Element Constructor
7.2.2. Computed Element Constructor
7.3. Attribute Nodes
7.3.1. Direct Attribute Constructors
7.3.2. Computed Attribute Constructors
7.4. Text Nodes
7.5. Document Nodes
7.6. Comment Nodes
7.7. Processing Instruction Nodes
7.8. Namespace Nodes
7.9. Composition
7.10. Validation
7.11. Element and Attribute Content
7.11.1. Character Escapes
7.11.2. Whitespace
7.11.3. Content Sequence
7.11.3.1. Attribute Content
7.11.3.2. Element Content
7.12. Conclusion
7.13. Further Reading
8. Text Processing
8.1. Introduction
8.2. The XML Character Model
8.2.1. Background
8.2.2. Code Points
8.2.3. Normalization
8.3. Character Encodings
8.4. Collations
8.5. Text Operators
8.6. Text Functions
8.7. Conclusion
8.8. Further Reading
9. Type Operators
9.1. Introduction
9.2. Cast and Castable
9.3. Type Conversion Rules
9.3.1. Converting Up and Down the Type Hierarchy
9.3.2. Converting Across the Type Hierarchy
9.3.2.1. Conversion to/from String
9.3.2.2. Conversion to/from Numeric Types and Boolean
9.3.2.3. Conversion to/from Calendar Types
9.3.2.4. Conversion to/from Binary Types
9.4. treat as
9.5. instance of and typeswitch
9.6. User-Defined Types
9.6.1. Schema Imports
9.6.2. Typed Content
9.6.3. Validation
9.7. Conclusion
9.8. Further Reading
III. Application
10. Practical Examples
10.1. Introduction
10.2. Style
10.2.1. Case
10.2.2. Spaces
10.2.3. Braces
10.2.4. Slice
10.2.5. Concise
10.3. Idioms
10.3.1. Text Idioms
10.3.1.1. Reverse a String
10.3.1.2. Comma-Separated Values
10.3.1.3. Lower-, Upper-, and Title-Case
10.3.1.4. Test for ASCII Characters
10.3.2. Navigation Idioms
10.3.2.1. Select Elements and Attributes Simultaneously
10.3.2.2. Navigate Case-Insensitively
10.3.2.3. Select Nodes by Type
10.3.2.4. Test Whether Two Nodes Are in the Same Tree
10.3.2.5. Select All Leaf Elements
10.3.2.6. Select All Ancestors
10.3.2.7. Select the First Common Ancestor
10.3.2.8. Select All Siblings
10.3.2.9. Calculate the Maximum Depth
10.3.3. Sequence Idioms
10.3.3.1. Union, Intersection, and Difference
10.3.3.2. Select Every Other Member
10.3.3.3. Permutations
10.3.4. Type Idioms
10.3.4.1. Binary Data
10.3.5. Logic Idioms
10.3.5.1. Boolean XOR
10.3.5.2. Three-Valued Logic
10.3.6. Arithmetic Idioms
10.3.6.1. IsNaN
10.3.6.2. Median
10.3.6.3. Rounding Modes
10.3.6.4. Random Number Generation
10.3.6.5. Factorial
10.3.6.6. Square Root
10.3.6.7. Complex Numbers
10.3.6.8. Linear Algebra
10.4. Conclusion
10.5. Further Reading
11. Surprises
11.1. Introduction
11.2. Confusion over Meaning
11.2.1. Numbers Like 3.14 Are Decimal, Not Double
11.2.2. Predicates Index Sequences, Not Strings
11.2.3. not(=) Is Not !=
11.2.4. Arithmetic Isn't Associative
11.2.5. Predicates + Abbreviated Axes = Confusion
11.2.6. Node Sequences Are Different from Node Siblings
11.2.7. No Sub-Tree Pruning
11.2.8. Type Conversions
11.2.9. What's in a Name?
11.2.10. FLWOR Doesn't Move the Current Context
11.2.11. Nested FLWOR Is Different
11.3. Confusion over Syntax
11.3.1. Punctuation Is Tricky
11.3.2. The <foo/><foo/> Problem
11.3.3. XML Numbers Aren't XQuery Numbers
11.3.4. Wacky Paths
11.4. Conclusion
12. XQuery Serialization
12.1. Introduction
12.2. XQuery Serialization
12.2.1. Sequences of Values
12.2.2. The Root
12.2.3. Serialization Parameters
12.3. XQueryX
12.4. Conclusion
13. Query Optimization
13.1. Introduction
13.2. Common Query Optimizations
13.2.1. Lazy Evaluation
13.2.2. Early Evaluation
13.2.3. Streaming and Database Evaluation
13.3. Barriers to Optimization
13.3.1. Node Identity
13.3.2. Sequence Order
13.3.3. Error Preservation
13.3.4. Side Effects
13.4. Formal Semantics
13.5. Conclusion
13.6. Further Reading
14. Beyond the Standard
14.1. Introduction
14.2. Potential Changes
14.2.1. Namespaces
14.2.2. Modules and Prolog
14.2.3. Additional Types
14.2.4. Simplify, Simplify
14.2.5. Built-in Functions
14.3. Standards Roadmap
14.3.1. Today
14.3.2. Tomorrow
14.4. XQuery 1.1
14.5. Data Manipulation
14.5.1. XQuery DML
14.5.2. SiXDML
14.5.3. XUpdate
14.6. Full-Text Search
14.7. Performance Benchmarks
14.8. Conclusion
14.9. Further Reading
IV. Reference
A. Data Model and Type System Reference
A.1. Introduction
A.2. Overview
A.3. Node Kinds
A.4. Atomic Types
A.5. Primitive Type Conversions
A.6. Built-in Atomic Types
B. Expression Reference
B.1. Introduction
for
let
where
order by
return
C. Function Reference
C.1. Introduction
D. Regular Expressions
D.1. Introduction
D.2. Overview
D.3. Advanced Regexps
D.4. Regexp Language
D.5. Character Properties
E. Grammar
E.1. Introduction
E.2. The XQuery Grammar
E.3. Reserved Keywords
E.4. Operator Precedence
Bibliography
Standards
Working Drafts and Notes
Further Reading
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Preface
Next
Next Chapter
1. A Tour of XQuery
Part I. Foundations
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset