Muutke küpsiste eelistusi

E-raamat: XQuery: Search Across a Variety of XML Data

  • Formaat: 762 pages
  • Ilmumisaeg: 02-Dec-2015
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781491915127
Teised raamatud teemal:
  • Formaat - PDF+DRM
  • Hind: 40,37 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: 762 pages
  • Ilmumisaeg: 02-Dec-2015
  • Kirjastus: O'Reilly Media
  • Keel: eng
  • ISBN-13: 9781491915127
Teised raamatud teemal:

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

With XQuery, you finally have a tool that will make it much easier to search, extract and manipulate information from XML content stored in databases. Updated for XQuery 3.0, this in-depth tutorial not only walks you through the XQuery specification, but also teaches you how to program with this highly practical 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 second edition provides:

  • A high-level overview and quick tour of XQuery
  • New chapters on switch expressions, dynamic function calls, and other features
  • 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’ll 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. 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.

Preface xvii
1 Introduction to XQuery 1(14)
What Is XQuery?
1(3)
Capabilities of XQuery
2(1)
Uses for XQuery
2(1)
Processing Scenarios
3(1)
Easing into XQuery
4(1)
Path Expressions
5(2)
FLWORs
7(1)
Adding XML Elements and Attributes
8(3)
Adding Elements
9(2)
Adding Attributes
11(1)
Functions
11(1)
Joins
12(1)
Aggregating and Grouping Values
12(3)
2 XQuery Foundations 15(16)
The Design and History of the XQuery Language
15(1)
XQuery in Context
16(2)
XQuery and XPath
16(1)
XQuery Versus XSLT
16(1)
XQuery Versus SQL
17(1)
XQuery and XML Schema
17(1)
Processing Queries
18(3)
Input Documents
18(1)
The Query
19(1)
The Context
20(1)
The Query Processor
20(1)
The Results of the Query
21(1)
The XQuery Data Model
21(7)
Nodes
22(4)
Atomic Values
26(1)
Sequences
27(1)
Types
28(1)
Namespaces
28(3)
3 Expressions: XQuery Building Blocks 31(16)
Categories of Expressions
31(1)
Keywords and Names
32(1)
Whitespace in Queries
33(1)
Literals
33(1)
Variables
34(1)
Function Calls
34(1)
Comments
35(1)
Precedence and Parentheses
35(2)
Comparison Expressions
37(4)
General Comparisons
37(1)
Value Comparisons
38(2)
Node Comparisons
40(1)
Conditional (if-then-else) Expressions
41(2)
Conditional Expressions and Effective Boolean Value
42(1)
Nesting Conditional Expressions
43(1)
Switch Expressions
43(2)
Logical (and/or) Expressions
45(2)
Precedence of Logical Expressions
45(1)
Negating a Boolean Value
46(1)
4 Navigating XML by Using Paths 47(18)
Path Expressions
47(7)
Path Expressions and Context
48(1)
Steps
49(1)
Axes
49(1)
Node Tests
50(3)
Abbreviated Syntax
53(1)
Other Expressions as Steps
53(1)
Predicates
54(6)
Comparisons in Predicates
55(1)
Using Positions in Predicates
56(3)
Using Multiple Predicates
59(1)
More Complex Predicates
59(1)
A Closer Look at Context
60(2)
Working with the Context Node
61(1)
Accessing the Root
61(1)
Dynamic Paths
62(1)
The Simple Map Operator
63(2)
5 Adding Elements and Attributes to Results 65(18)
Including Elements and Attributes from the Input Document
65(1)
Direct Element Constructors
66(11)
Containing Literal Characters
67(1)
Containing Other Element Constructors
68(1)
Containing Enclosed Expressions
68(3)
Specifying Attributes Directly
71(1)
Declaring Namespaces in Direct Constructors
72(1)
Use Case: Modifying an Element from the Input Document
73(1)
Direct Element Constructors and Whitespace
74(3)
Computed Constructors
77(6)
Computed Element Constructors
77(3)
Computed Attribute Constructors
80(1)
Use Case: Turning Content to Markup
80(3)
6 Selecting and Joining Using FLWORs 83(16)
Selecting with Path Expressions
83(1)
FLWOR Expressions
83(8)
The for Clause
85(3)
The let Clause
88(1)
The where Clause
89(1)
The return Clause
90(1)
The Scope of Variables
91(1)
Quantified Expressions
91(2)
Binding Multiple Variables
93(1)
Selecting Distinct Values
93(2)
Joins
95(4)
Three-Way Joins
96(1)
Outer Joins
96(2)
Joins and Types
98(1)
7 Sorting and Grouping 99(20)
Sorting in XQuery
99(9)
The order by Clause
99(4)
The sort Function
103(1)
Document Order
103(2)
Document Order Comparisons
105(1)
Reversing the Order
106(1)
Indicating That Order Is Not Significant
106(2)
Grouping
108(4)
Grouping Using the group by Clause
109(3)
Aggregating Values
112(7)
Ignoring "Missing" Values
114(1)
Counting "Missing" Values
115(1)
Aggregating on Multiple Values
116(1)
Constraining and Sorting on Aggregated Values
116(3)
8 Functions 119(14)
Built-in Versus User-Defined Functions
119(1)
Calling Functions
119(5)
Function Names
120(1)
Function Signatures
121(1)
Argument Lists
121(2)
Sequence Types
123(1)
Calling Functions with the Arrow Operator
124(1)
User-Defined Functions
124(9)
Why Define Your Own Functions?
124(1)
Function Declarations
125(1)
The Function Body
126(1)
The Function Name
127(1)
The Parameter List
127(3)
Functions and Context
130(1)
Recursive Functions
130(3)
9 Advanced Queries 133(24)
Working with Positions and Sequence Numbers
133(5)
Adding Sequence Numbers to Results
133(2)
Using the count Clause
135(2)
Testing for the Last Item
137(1)
Windowing
138(6)
Using start and end Conditions
140(1)
Windows Based on Position
141(1)
Windows Based on Previous or Next Items
142(1)
Sliding Windows
143(1)
Copying Input Elements with Modifications
144(6)
Adding Attributes to an Element
145(1)
Removing Attributes from an Element
146(1)
Removing Attributes from All Descendants
147(1)
Removing Child Elements
147(1)
Changing Names
148(2)
Combining Results
150(2)
Sequence Constructors
150(1)
The union Expression
151(1)
The intersect Expression
151(1)
The except Expression
151(1)
Using Intermediate XML Documents
152(5)
Creating Lookup Tables
152(1)
Reducing Complexity
153(4)
10 Namespaces and XQuery 157(22)
XML Namespaces
157(4)
Namespace URIs
157(1)
Declaring Namespaces
158(1)
Default Namespace Declarations
159(1)
Namespaces and Attributes
159(1)
Namespace Declarations and Scope
160(1)
Namespaces and XQuery
161(1)
Namespace Declarations in Queries
162(8)
Predeclared Namespaces
162(1)
Prolog Namespace Declarations
163(3)
Namespace Declarations in Direct Element Constructors
166(1)
Namespace Declarations in Computed Constructors
167(1)
The Impact and Scope of Namespace Declarations
168(2)
Controlling Namespace Declarations in Your Results
170(7)
In-Scope Versus Statically Known Namespaces
171(3)
Controlling the Copying of Namespace Declarations
174(3)
URI-Qualified Names
177(2)
11 A Closer Look at Types 179(22)
The XQuery Type System
179(2)
Advantages of a Strong Type System
179(1)
Do You Need to Care About Types?
180(1)
The Built-in Types
181(2)
Atomic Types
181(2)
List Types
183(1)
Union Types
183(1)
Types, Nodes, and Atomic Values
183(1)
Nodes and Types
183(1)
Atomic Values and Types
184(1)
Type Checking in XQuery
184(1)
The Static Analysis Phase
184(1)
The Dynamic Evaluation Phase
185(1)
Automatic Type Conversions
185(5)
Subtype Substitution
185(1)
Type Promotion
186(1)
Casting of Untyped Values
186(1)
Atomization
186(1)
Effective Boolean Value
187(2)
Function Conversion Rules
189(1)
Sequence Types
190(5)
Occurrence Indicators
191(1)
Generic Sequence Types
192(1)
Simple Type Names as Sequence Types
193(1)
Element and Attribute Tests
193(1)
Sequence Type Matching
194(1)
The instance of Expression
194(1)
Constructors and Casting
195(6)
Constructors
195(1)
The Cast Expression
196(1)
The Castable Expression
197(1)
Casting Rules
198(3)
12 Prologs, Modules, and Variables 201(12)
Structure of a Query: Prolog and Body
201(3)
Prolog Declarations
202(1)
The Version Declaration
203(1)
Assembling Queries from Multiple Modules
204(4)
Library Modules
204(1)
Importing a Library Module
205(2)
Loading a Library Module Dynamically
207(1)
Variable Declarations
208(3)
Variable Declaration Syntax
208(1)
The Scope of Variables
209(1)
Variable Names
209(1)
Initializing Expressions
210(1)
External Variables
210(1)
Private Functions and Variables
211(1)
Declaring External Functions
211(2)
13 Inputs and Outputs 213(14)
Types of Input and Output Documents
213(1)
Accessing Input Documents
214(3)
Accessing a Single Document with a Function
214(1)
Accessing a Collection
215(1)
Setting the Context Outside the Query
216(1)
Using Variables
216(1)
Setting the Context in the Prolog
217(1)
Serializing Output
217(10)
Serialization Methods
218(2)
Serialization Parameters
220(4)
Specifying Serialization Parameters by Using Option Declarations
224(1)
Specifying Serialization Parameters by Using a Separate XML Document
225(1)
Serialization Errors
226(1)
Serializing to a String
226(1)
14 Using Schemas with XQuery 227(18)
What Is a Schema?
227(1)
Why Use Schemas with Queries?
228(2)
W3C XML Schema: A Brief Overview
230(3)
Element and Attribute Declarations
230(1)
Types
231(1)
Namespaces and XML Schema
232(1)
In-Scope Schema Definitions
233(3)
Where Do In-Scope Schema Definitions Come From?
233(1)
Schema Imports
234(2)
Schema Validation and Type Assignment
236(5)
The Validate Expression
236(2)
Validation Mode
238(1)
Assigning Type Annotations to Nodes
238(1)
Nodes and Typed Values
239(1)
Types and Newly Constructed Elements and Attributes
240(1)
Sequence Types and Schemas
241(4)
15 Static Typing 245(10)
What Is Static Typing?
245(3)
Obvious Static Type Errors
246(1)
Static Typing and Schemas
246(1)
Raising "False" Errors
247(1)
Static Typing Expressions and Constructs
247(1)
The Typeswitch Expression
248(2)
The Treat Expression
250(1)
Type Declarations
251(2)
Type Declarations in FLWORs
251(1)
Type Declarations in Quantified Expressions
252(1)
Type Declarations in Global Variable Declarations
253(1)
The zero-or-one, one-or-more, and exactly-one Functions
253(2)
16 Writing Better Queries 255(14)
Query Design Goals
255(1)
Clarity
256(3)
Improving the Layout
256(1)
Choosing Names
257(1)
Using Comments for Documentation
257(2)
Modularity
259(1)
Robustness
259(3)
Handling Data Variations
259(1)
Handling Missing Values
260(2)
Error Handling
262(3)
Avoiding Dynamic Errors
262(1)
The error and trace Functions
263(1)
Try/Catch Expressions
263(2)
Performance
265(4)
Avoid Reevaluating the Same or Similar Expressions
266(1)
Avoid Unnecessary Sorting
266(1)
Avoid Expensive Path Expressions
267(1)
Use Predicates Instead of where Clauses
268(1)
17 Working with Numbers 269(14)
The Numeric Types
269(1)
The xs:decimal Type
269(1)
The xs:integer Type
269(1)
The xs:float and xs:double Types
270(1)
The xs:numeric Type
270(1)
Constructing Numeric Values
270(2)
The number Function
271(1)
Numeric Type Promotion
271(1)
Comparing Numeric Values
272(1)
Arithmetic Operations
273(4)
Arithmetic Operations on Multiple Values
274(1)
Arithmetic Operations and Types
274(1)
Precedence of Arithmetic Operators
274(1)
Addition, Subtraction, and Multiplication
275(1)
Division
275(1)
Modulus (Remainder)
276(1)
Functions on Numbers
277(2)
Formatting Numbers
279(4)
Formatting Integers
279(1)
Formatting Decimal Numbers
280(1)
The Decimal Format Declaration
280(3)
18 Working with Strings 283(16)
The xs:string Type
283(1)
Constructing Strings
283(1)
String Literals
284(1)
The xs:string Constructor and the string Function
284(1)
Comparing Strings
284(3)
Comparing Entire Strings
285(1)
Determining Whether a String Contains Another String
285(1)
Matching a String to a Pattern
286(1)
Substrings
287(1)
Finding the Length of a String
288(1)
Concatenating and Splitting Strings
289(2)
Concatenating Strings
289(1)
Splitting Strings Apart
290(1)
Converting Between Codepoints and Strings
291(1)
Manipulating Strings
291(3)
Converting Between Uppercase and Lowercase
291(1)
Replacing Individual Characters in Strings
292(1)
Replacing Substrings That Match a Pattern
292(2)
Whitespace and Strings
294(1)
Normalizing Whitespace
294(1)
Internationalization Considerations
295(4)
Collations
295(2)
Unicode Normalization
297(1)
Determining the Language of an Element
297(2)
19 Regular Expressions 299(16)
The Structure of a Regular Expression
299(2)
Atoms
299(1)
Quantifiers
299(1)
Parenthesized Sub-Expressions and Branches
300(1)
Representing Individual Characters
301(2)
Representing Any Character
303(1)
Representing Groups of Characters
303(3)
Multi-Character Escapes
304(1)
Category Escapes
304(1)
Block Escapes
305(1)
Character Class Expressions
306(2)
Single Characters and Ranges
306(1)
Subtraction from a Range
307(1)
Negative Character Class Expressions
307(1)
Escaping Rules for Character Class Expressions
308(1)
Reluctant Quantifiers
308(1)
Anchors
309(1)
Back-References
310(1)
Using Flags
311(1)
Using Sub-Expressions with Replacement Variables
312(3)
20 Working with Dates, Times, and Durations 315(14)
The Date and Time Types
315(4)
Constructing and Casting Dates and Times
316(1)
Time Zones
317(1)
Comparing Dates and Times
318(1)
The Duration Types
319(2)
The xs:yearMonthDuration and xs:dayTimeDuration Types
320(1)
Comparing Durations
320(1)
Extracting Components of Dates, Times, and Durations
321(1)
Formatting Dates and Times
322(1)
Using Arithmetic Operators on Dates, Times, and Durations
323(4)
Subtracting Dates and Times
323(1)
Adding and Subtracting Durations from Dates and Times
324(1)
Adding and Subtracting Two Durations
325(1)
Multiplying and Dividing Durations by Numbers
326(1)
Dividing Durations by Durations
326(1)
The Date Component Types
327(2)
21 Working with Qualified Names, URIs, and IDs 329(14)
Working with Qualified Names
329(5)
Retrieving Node Names
330(2)
Constructing Qualified Names
332(1)
Other Name-Related Functions
333(1)
Working with URIs
334(5)
Base and Relative URIs
334(2)
Documents and URIs
336(2)
Escaping URIs
338(1)
Working with IDs
339(4)
Joining IDs and IDREFs
340(1)
Constructing ID Attributes
341(1)
Generating Unique ID Values
341(2)
22 Working with Other XML Constructs 343(16)
XML Comments
343(3)
XML Comments and the Data Model
343(1)
Querying Comments
344(1)
Comments and Sequence Types
344(1)
Constructing Comments
345(1)
Processing Instructions
346(3)
Processing Instructions and the Data Model
346(1)
Querying Processing Instructions
347(1)
Processing Instructions and Sequence Types
347(1)
Constructing Processing Instructions
348(1)
Documents
349(2)
Document Nodes and the Data Model
349(1)
Document Nodes and Sequence Types
350(1)
Constructing Document Nodes
350(1)
Text Nodes
351(4)
Text Nodes and the Data Model
351(1)
Querying Text Nodes
352(1)
Text Nodes and Sequence Types
353(1)
Why Work with Text Nodes?
353(2)
Constructing Text Nodes
355(1)
XML Entity and Character References
355(2)
CDATA Sections
357(2)
23 Function Items and Higher-Order Functions 359(10)
Why Higher-Order Functions?
359(1)
Constructing Functions and Calling Them Dynamically
360(4)
Named Function References
360(1)
Using function- lookup to Obtain a Function
361(1)
Inline Function Expressions
361(1)
Partial Function Application
362(1)
The Arrow Operator and Dynamic Function Calls
363(1)
Syntax Recap
363(1)
Functions and Sequence Types
364(1)
Higher-Order Functions
364(5)
Built-In Higher-Order Functions
365(1)
Writing Your Own Higher-Order Functions
366(3)
24 Maps, Arrays, and JSON 369(22)
Maps
369(9)
Constructing Maps
369(2)
Looking Up Map Values
371(4)
Querying Maps
375(1)
Changing Maps
375(1)
Iterating over Entries in a Map
376(1)
Maps and Sequence Types
376(2)
Arrays
378(7)
Constructing Arrays
378(1)
Arrays Versus Sequences
379(1)
Arrays and Atomization
380(1)
Looking Up Array Values
380(2)
Querying Arrays
382(1)
Changing Arrays
383(1)
Arrays and Sequence Types
384(1)
JSON
385(6)
Parsing JSON
385(1)
Serializing JSON
386(1)
Converting Between JSON and XML
387(4)
25 Implementation-Specific Features 391(8)
Conformance
391(1)
Version Support
392(2)
New Features in XQuery 3.0
392(1)
New Features in XQuery 3.1
393(1)
Setting the Query Context
394(1)
The Option Declaration
395(1)
Extension Expressions
396(1)
Annotations
397(2)
26 XQuery for SQL Users 399(14)
Relational Versus XML Data Models
399(2)
Comparing SQL Syntax with XQuery Syntax
401(7)
A Simple Query
401(1)
Conditions and Operators
402(2)
Functions
404(1)
Selecting Distinct Values
405(1)
Working with Multiple Tables and Subqueries
406(2)
Grouping
408(1)
Combining SQL and XQuery
408(3)
Combining Structured and Semi-Structured Data
409(1)
Flexible Data Structures
409(2)
SQL/XML
411(2)
27 XQuery for XSLT Users 413(12)
XQuery and XPath
413(1)
XQuery Versus XSLT
413(7)
Shared Components
414(1)
Equivalent Components
414(1)
Differences
415(5)
Using XQuery and XSLT Together
420(1)
XQuery Backward Compatibility with XPath 1.0
421(4)
Data Model
421(1)
New Expressions
422(1)
Path Expressions
422(1)
Function Conversion Rules
423(1)
Arithmetic and Comparison Expressions
423(1)
Built-in Functions
424(1)
28 Additional XQuery-Related Standards 425(10)
XQuery Update Facility
425(1)
Full-Text Search
426(2)
XQueryX
428(2)
RESTXQ
430(2)
XQuery API for Java (XQJ)
432(3)
A Built-in Function Reference 435(200)
B Built-in Types 635(32)
C Error Summary 667(38)
Index 705
Priscilla Walmsley serves as Managing Director of Datypic, a consultancy specializing in XML architecture and design, SOA and Web services implementation, and content management. She was a member of the W3C XML Schema Working Group from 1999 to 2004. She is the author of XQuery from O'Reilly and Definitive XML Schema (Prentice Hall). In addition, she co-authored the book Web Service Contract Design and Versioning for SOA.