NOTE-xquery-requirements-20070323
42.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>XML Query (XQuery) Requirements </title><style type="text/css">
code { font-family: monospace; }
div.constraint,
div.issue,
div.note,
div.notice { margin-left: 2em; }
ol.enumar { list-style-type: decimal; }
ol.enumla { list-style-type: lower-alpha; }
ol.enumlr { list-style-type: lower-roman; }
ol.enumua { list-style-type: upper-alpha; }
ol.enumur { list-style-type: upper-roman; }
div.exampleInner pre { margin-left: 1em;
margin-top: 0em; margin-bottom: 0em}
div.exampleOuter {border: 4px double gray;
margin: 0em; padding: 0em}
div.exampleInner { background-color: #d5dee3;
border-top-width: 4px;
border-top-style: double;
border-top-color: #d3d3d3;
border-bottom-width: 4px;
border-bottom-style: double;
border-bottom-color: #d3d3d3;
padding: 4px; margin: 0em }
div.exampleWrapper { margin: 4px }
div.exampleHeader { font-weight: bold;
margin: 4px}
</style><link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-WG-NOTE.css"></head><body><div class="head"><p><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72"></a></p>
<h1><a name="title" id="title"></a>XML Query (XQuery) Requirements </h1>
<h2><a name="w3c-doctype" id="w3c-doctype"></a>W3C Working Group Note 23 March 2007</h2><dl><dt>This version:</dt><dd>
<a href="http://www.w3.org/TR/2007/NOTE-xquery-requirements-20070323">http://www.w3.org/TR/2007/NOTE-xquery-requirements-20070323</a>
</dd><dt>Latest version:</dt><dd>
<a href="http://www.w3.org/TR/xquery-requirements/">http://www.w3.org/TR/xquery-requirements/</a></dd><dt>Previous version:</dt><dd>
<a href="http://www.w3.org/TR/2005/WD-xquery-requirements-20050603/">http://www.w3.org/TR/2005/WD-xquery-requirements-20050603/</a>
</dd><dt>Editors:</dt><dd>Don Chamberlin, IBM Almaden Research Center <a href="mailto:chamberlin@almaden.ibm.com"><chamberlin@almaden.ibm.com></a></dd><dd>Peter Fankhauser, Infonyte GmbH <a href="mailto:fankhaus@infonyte.com"><fankhaus@infonyte.com></a></dd><dd>Massimo Marchiori, W3C/MIT/University of Venice <a href="mailto:massimo@w3.org"><massimo@w3.org></a></dd><dd>Jonathan Robie, DataDirect <a href="mailto:jonathan.robie@datadirect-technologies.com"><jonathan.robie@datadirect-technologies.com></a></dd></dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2007 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div><hr><div>
<h2><a name="abstract" id="abstract"></a>Abstract</h2><p>This document specifies goals, requirements, and usage scenarios for the
W3C XML Query (XQuery) data model and query language. It also
includes, for each requirement, a corresponding
<a title="" href="#req-status">status</a>, indicating the status
of the requirement in the XQuery 1.0 family of W3C Recommendations.</p></div><div>
<h2><a name="status" id="status"></a>Status of this Document</h2><p><em>This section describes the status of this document at the time of its publication.
Other documents may supersede this document.
A list of current W3C publications and the latest revision of this technical report
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a>
at http://www.w3.org/TR/.</em></p><p>This is the W3C <a href="http://www.w3.org/2005/10/Process-20051014/tr.html#tr-end">Working
Group Note</a> of "XML Query (XQuery) Requirements", produced by the W3C
<a href="http://www.w3.org/XML/Query/">XML Query Working Group</a>, part of the
<a href="http://www.w3.org/XML/Activity">XML Activity</a>.
This document is being published as a
<a href="http://www.w3.org/2005/10/Process-20051014/tr.html#tr-end">Working Group Note</a>
to persistently record the Requirements that guided the development of
<a href="http://www.w3.org/TR/xquery/">XQuery 1.0: An XML Query Language</a>
and its associated specifications as W3C Recommendations.</p><p>Please submit comments about this document using W3C's
<a href="http://www.w3.org/Bugs/Public/">public Bugzilla system</a>
(instructions can be found at
<a href="http://www.w3.org/XML/2005/04/qt-bugzilla">http://www.w3.org/XML/2005/04/qt-bugzilla</a>).
If access to that system is not feasible, you may send your comments to the
W3C XSLT/XPath/XQuery public comments mailing list,
<a href="mailto:public-qt-comments@w3.org">public-qt-comments@w3.org</a>.
It will be very helpful if you include the string [XQRecRequirements] in the subject line
of your report, whether made in Bugzilla or in email.
Each Bugzilla entry and email message should contain only one comment.
Archives of the comments and responses are available at
<a href="http://lists.w3.org/Archives/Public/public-qt-comments/">http://lists.w3.org/Archives/Public/public-qt-comments/</a>.</p>
<!--* <p>Publication as a <a
href="http://www.w3.org/2005/10/Process-20051014/tr.html#tr-end">Working
Group Note</a> does not imply endorsement by the W3C Membership. This
is a draft document and may be updated, replaced or obsoleted by other
documents at any time. It is inappropriate to cite this document as
other than work in progress.</p> *-->
<p>Publication as a <a
href="http://www.w3.org/2005/10/Process-20051014/tr.html#tr-end">Working
Group Note</a> does not imply endorsement by the W3C Membership.
At the time of publication, work on this
document was considered complete and no further revisions are
anticipated. It is a stable document and may be used as reference
material or cited from another document. However, this document may
be updated, replaced, or made obsolete by other documents at any
time.</p>
<p>This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>.
W3C maintains a
<a href="http://www.w3.org/2004/01/pp-impl/18797/status#disclosures">public list
of any patent disclosures</a> made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6
of the W3C Patent Policy</a>. </p></div><div class="toc">
<h2><a name="contents" id="contents"></a>Table of Contents</h2><p class="toc">1 <a href="#d0e177">Goals</a><br>
2 <a href="#d0e191">Usage Scenarios</a><br>
3 <a href="#Requirements">Requirements</a><br>
3.1 <a href="#d0e256">Terminology</a><br>
3.2 <a href="#d0e318">General Requirements</a><br>
3.3 <a href="#d0e471">XML Query Data Model</a><br>
3.4 <a href="#d0e639">XML Query Functionality</a><br>
4 <a href="#relationships">Relationship to Other Activities</a><br>
5 <a href="#d0e1169">References (non-normative)</a><br>
</p>
<h3><a name="appendices" id="appendices"></a>Appendix</h3><p class="toc">A <a href="#d0e1268">Glossary</a><br>
</p></div><hr><div class="body"><div class="div1">
<h2><a name="d0e177" id="d0e177"></a>1 Goals</h2><p>The goal of the XML Query Working Group is to produce a data model for
XML documents, a set of query operators on that data model, and a query
language based on these query operators. The data model will be based on the
<a href="http://www.w3.org/TR/xml-infoset/">W3C XML Infoset</a>, and will
include support for
<a href="http://www.w3.org/TR/1999/REC-xml-names-19990114/">Namespaces</a>.</p><p>Queries operate on single documents or fixed collections of documents.
They can select whole documents or subtrees of documents that match
conditions defined on document content and structure, and can construct new
documents based on what is selected.</p></div><div class="div1">
<h2><a name="d0e191" id="d0e191"></a>2 Usage Scenarios</h2><p>The following usage scenarios describe how XML queries may be used in
various environments, and represent a wide range of activities and needs that
are representative of the problem space to be addressed. They are intended
to be used as design cases during the development of XML Query, and should be
reviewed when critical decisions are made. These usage scenarios should also
prove useful in helping non-members of the XML Query Working Group understand
the intent and goals of the project.</p><dl><dt class="label">2.1 Human-readable documents</dt><dd><p>Perform queries on structured documents and collections of documents, such
as technical manuals, to retrieve individual documents, to generate tables of
contents, to search for information in structures found within a document, or
to generate new documents as the result of a query.</p></dd><dt class="label">2.2 Data-oriented documents</dt><dd><p>Perform queries on the XML representation of database data, object data,
or other traditional data sources to extract data from these sources, to
transform data into new XML representations, or to integrate data from
multiple heterogeneous data sources. The XML representation of data sources
may be either physical or virtual; that is, data may be physically encoded in
XML, or an XML representation of the data may be produced.</p></dd><dt class="label">2.3 Mixed-model documents</dt><dd><p>Perform both document-oriented and data-oriented queries on documents with
embedded data, such as catalogs, patient health records, employment records,
or business analysis documents.</p></dd><dt class="label">2.4 Administrative data</dt><dd><p>Perform queries on configuration files, user profiles, or administrative
logs represented in XML.</p></dd><dt class="label">2.5 Filtering streams</dt><dd><p>Perform queries on streams of XML data to process the data in a manner
analogous to UNIX filters. This might be used to process logs of email
messages, network packets, stock market data, newswire feeds, EDI, or weather
data to filter and route messages represented in XML, to extract data from
XML streams, or to transform data in XML streams.</p></dd><dt class="label">2.6 Document Object Model (DOM)</dt><dd><p>Perform queries on DOM structures to return sets of nodes that meet the
specified criteria.</p></dd><dt class="label">2.7 Native XML repositories and web servers</dt><dd><p>Perform queries on collections of documents managed by native XML
repositories or web servers.</p></dd><dt class="label">2.8 Catalog search</dt><dd><p>Perform queries to search catalogs that describe document servers,
document types, XML schemas, or documents. Such catalogs may be combined to
support search among multiple servers. A document-retrieval system could use
queries to allow the user to select server catalogs, represented in XML, by
the information provided by the servers, by access cost, or by authorization.
Once a server is selected, a retrieval system could query the kinds of
documents found on the server and allow the user to query those documents.</p></dd><dt class="label">2.9 Multiple syntactic environments</dt><dd><p>Queries may be used in many environments. For example, a query might be
embedded in a URL, an XML page, or a JSP or ASP page; represented by a string
in a program written in a general-purpose programming language; provided as
an argument on the command-line or standard input; or supported by a
protocol, such as DASL or Z39.50.</p></dd></dl></div><div class="div1">
<h2><a name="Requirements" id="Requirements"></a>3 Requirements</h2><div class="div2">
<h3><a name="d0e256" id="d0e256"></a>3.1 Terminology</h3><p>The following key words are used throughout the document to specify the
extent to which an item is a requirement for the work of the XML Query
Working Group:</p><dl><dt class="label"><a name="terminology-must" id="terminology-must"></a>MUST</dt><dd><p>This word means that the item is an absolute requirement.</p></dd><dt class="label"><a name="terminology-should" id="terminology-should"></a>SHOULD</dt><dd><p>This word means that there may exist valid reasons not to treat this item
as a requirement, but the full implications should be understood and the case
carefully weighed before discarding this item.</p></dd><dt class="label"><a name="terminology-may" id="terminology-may"></a>MAY</dt><dd><p>This word means that an item deserves attention, but further study is
needed to determine whether the item should be treated as a
requirement.</p></dd></dl><p>When the words
<a href="#terminology-must">MUST</a>,
<a href="#terminology-should">SHOULD</a>, or
<a href="#terminology-may">MAY</a> are used in this technical sense, they
occur as a hyperlink to these definitions. These words will also be used with
their conventional English meaning, in which case there is no hyperlink. For
instance, the phrase "the full implications should be understood" uses the
word "should" in its conventional English sense, and therefore occurs without
the hyperlink.</p><p id="req-status">Each requirement also includes a status section,
indicating its current situation in the XML-Query family of specifications.
Three status levels are used:</p><dl><dt class="label">"Green" status</dt><dd><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status"> This indicates that the requirement, according to its
original formulation, has been completely met. Optional clarificatory text
may follow.</p></dd><dt class="label">"Yellow" status</dt><dd><p>
<img src="http://www.w3.org/Icons/yellow-ball.gif" alt="yellow status"> This indicates that the requirement has been partially met
according to its original formulation. When this happens, explanatory text is
provided to better clarify the current scope of the
requirement.</p></dd><dt class="label">"Red" status</dt><dd><p>
<img src="http://www.w3.org/Icons/red-ball.gif" alt="red status"> This indicates that the requirement, according to its
original formulation, has not been met. If this is the case, explanatory text
is provided.</p></dd></dl></div><div class="div2">
<h3><a name="d0e318" id="d0e318"></a>3.2 General Requirements</h3><dl><dt class="label">3.2.1 Query Language Syntax</dt><dd><p>The XML Query Language
<a href="#terminology-may">MAY</a> have more than one syntax binding.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>The XML Query Language
<a href="#terminology-must">MUST</a> be convenient for humans to read and write.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>One query language syntax <a href="#terminology-must">MUST</a>
be expressed in XML in a way that reflects the underlying structure of
the query.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.2.2 Declarativity</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> be declarative. Notably, it
<a href="#terminology-must">MUST</a> not enforce a particular evaluation
strategy.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.2.3 Protocol Independence</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> be defined independently of any
protocols with which it is used. (Relationships to some specific protocols
are discussed in
<a href="#relationships"><b>4 Relationship to Other Activities</b></a>.)</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.2.4 Error Conditions</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> define standard error conditions
that can occur during the execution of a query, such as processing errors
within expressions, unavailability of external functions to the query
processor, or processing errors generated by external functions.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.2.5 Updates</dt><dd><p>Version 1.0 of the XML Query Language
<a href="#terminology-must">MUST</a> not preclude the ability to add
update capabilities in future versions.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.
The XML Query WG has begun work on update capabilities (see
<a href="#UpdateRequirements">XQuery Update Facility Requirements</a>).
</p></dd><dt class="label">3.2.6 Defined for Finite Instances</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> be defined for finite instances of
the data model.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>It
<a href="#terminology-may">MAY</a> be defined for infinite instances.</p><p>
<img src="http://www.w3.org/Icons/red-ball.gif" alt="red status">
<em>Status:</em> this requirement has not been met. The XQuery Data Model
defines only finite sequences.</p></dd></dl></div><div class="div2">
<h3><a name="d0e471" id="d0e471"></a>3.3 XML Query Data Model</h3><dl><dt class="label">3.3.1 Reliance on XML Information Set</dt><dd><p>The XML Query Data Model relies on information provided by XML Processors
and Schema Processors, and it
<a href="#terminology-must">MUST</a> ensure that it does not require
information that is not made available by such processors.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>For XML constructs found in XML 1.0 or the Namespaces Recommendation, the
XML Query Data Model
<a href="#terminology-must">MUST</a> show how the equivalent XML Query
Data Model constructs are built from items in the XML Information Set.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>The XML Query Data Model
<a href="#terminology-should">SHOULD</a> represent all information items,
or provide justification for any information items omitted.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.
For each node type, the XQuery Data Model contains a section on how it
can be constructed from an Infoset.
</p><p>For information found in the XML Schema, such as datatypes, the XML Query
Working Group
<a href="#terminology-must">MUST</a> coordinate with the XML Schema
Working Group to ensure that schema processors may be relied on to provide
the information needed to construct the Data Model.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label"><a name="datatypes" id="datatypes"></a>3.3.2 Datatypes</dt><dd><p>The XML Query Data Model
<a href="#terminology-must">MUST</a> represent both XML 1.0 character
data and the simple and complex types of the XML Schema specification.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label"><a name="collections" id="collections"></a>3.3.3 Collections</dt><dd><p>The XML Query Data Model
<a href="#terminology-must">MUST</a> represent collections of documents
and collections of simple and complex values. (Note that collections are not
part of the current XML Infoset.)</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label"><a name="references" id="references"></a>3.3.4 References</dt><dd><p>The XML Query Data Model
<a href="#terminology-must">MUST</a> include support for references,
including both references within an XML document and references from one XML
document to another.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been partially met.
Support for XPointer was considered, but was not provided.
An explicit defererence operator was considered, but ultimately dropped (see issue
<a href="http://www.w3.org/Style/XSL/Group/xpath2-tf/issues_full.htm#xquery-dereference-links">134</a>,
<a href="http://cgi.w3.org/MemberAccess/AccessRequest">W3C members
only</a>).</p></dd><dt class="label">3.3.5 Schema Availability</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be possible whether or not a schema
is available (in this document, the term "schema" may refer to either an XML
Schema or a DTD).</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>If a schema is available, the data model
<a href="#terminology-must">MUST</a> represent any items that they define
for their instances, such as default attributes, entity expansions, or data
types. These items will not be present if a schema is not present.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.
Note that not all XML Schema components are fully supported.
</p></dd><dt class="label">3.3.6 Namespace Awareness</dt><dd><p>The XML Query Language and XML Query Language Data Model
<a href="#terminology-must">MUST</a> be namespace aware.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been
met.</p></dd></dl></div><div class="div2">
<h3><a name="d0e639" id="d0e639"></a>3.4 XML Query Functionality</h3><dl><dt class="label">3.4.1 Supported Operations</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> support operations on all data types
represented by the XML Query Data Model (see
<a href="#datatypes">datatypes</a>,
<a href="#collections">collections</a>,
<a href="#references">references</a>).</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.2 Text and Element Boundaries</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to express simple
conditions on text, including conditions on text that spans element
boundaries.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met. This requirement is
satisfied by the ability of the
<code>string()</code> function to return the text content of an element,
including text within sub-elements. This requirement will be even better
supported in a future version of XQuery by Full-Text operations
(see the
<a href="#FullTextRequirements">XQuery and XPath Full-Text Requirements</a>).
</p></dd><dt class="label">3.4.3 Universal and Existential Quantifiers</dt><dd><p>Operations on collections
<a href="#terminology-must">MUST</a> include support for universal and
existential quantifiers.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.4 Hierarchy and Sequence</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> support operations on hierarchy and
sequence of document structures.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.5 Combination</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> be able to combine related
information from different parts of a given document or from multiple
documents.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.6 Aggregation</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> be able to compute summary
information from a group of related document elements (this operation is
sometimes called "aggregation.")</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.7 Sorting</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> be able to sort query results.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.8 Composition of Operations</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> support expressions in which
operations can be composed, including the use of queries as operands.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.9 NULL Values</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> include support for NULL values.
Therefore, all operators, including logical operators,
<a href="#terminology-must">MUST</a> take NULL values into account.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met. The closest analog for an
SQL null value is XQuery's empty sequence. The
<code>xsi:nil='true'</code> attribute is also supported.</p></dd><dt class="label">3.4.10 Structural Preservation</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to preserve the relative
hierarchy and sequence of input document structures in query results.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.11 Structural Transformation</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to transform XML structures
and
<a href="#terminology-must">MUST</a> be able to create new
structures.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.12 References</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to traverse intra- and
inter-document references.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been partially met.
Support for XPointer was considered, but was
not provided.
An explicit defererence operator was considered, but ultimately dropped (see issue
<a href="http://www.w3.org/Style/XSL/Group/xpath2-tf/issues_full.htm#xquery-dereference-links">134</a>,
<a href="http://cgi.w3.org/MemberAccess/AccessRequest">W3C members
only).</a></p></dd><dt class="label">3.4.13 Identity Preservation</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to preserve the identity of
items in the XML Query Data Model.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.14 Operations on Literal Data</dt><dd><p>Queries
<a href="#terminology-should">SHOULD</a> be able operate on XML Query
Data Model instances specified with the query ("literal" data).</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.15 Operations on Names</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to perform simple
operations on names, such as tests for equality in element names, attribute
names, and processing instruction targets, and to perform simple operations
on combinations of names and data.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>Queries
<a href="#terminology-may">MAY</a> perform more powerful operations on
names.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met. Computed constructors
give us this capability.</p></dd><dt class="label">3.4.16 Operations on Schemas</dt><dd><p>Queries
<a href="#terminology-should">SHOULD</a> provide access to the XML
schema or DTD for a document, if there is one.</p><p>
<img src="http://www.w3.org/Icons/red-ball.gif" alt="red status">
<em>Status:</em> this requirement has not been met. Support for this
requirement was felt to be too complex for XQuery 1.0. An XML Schema document
can be queried independently by a user.</p><p>If the schema is represented as a DTD, a mapping to an appropriate XML
Schema representation
<a href="#terminology-may">MAY</a> be required.</p><p>
<img src="http://www.w3.org/Icons/red-ball.gif" alt="red status">
<em>Status:</em> this requirement has not been met. This requirement was
not supported because the previous requirement was not
supported.</p></dd><dt class="label">3.4.17 Operations on Schema PSV Infoset</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be able to operate on information
items provided by the post-schema-validation information set defined by XML
Schema.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met. Data Model instances are
constructed from the XML Schema PSVI.</p></dd><dt class="label">3.4.18 Extensibility</dt><dd><p>The XML Query Language
<a href="#terminology-must">SHOULD</a> support the use of externally
defined functions on all datatypes of the XML Query Data Model. The interface
to such functions
<a href="#terminology-must">SHOULD</a> be defined by the Query Language,
and
<a href="#terminology-must">SHOULD</a> distinguish these functions from
functions defined in the Query Language. The implementation of externally
defined functions is not part of the Query Language.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p></dd><dt class="label">3.4.19 Environment Information</dt><dd><p>The XML Query Language
<a href="#terminology-must">MUST</a> provide access to information
derived from the environment in which the query is executed, such as the
current date, time, locale, time zone, or user.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met. XQuery supports access to
the current date, time, and timezone.</p></dd><dt class="label">3.4.20 Closure</dt><dd><p>Queries
<a href="#terminology-must">MUST</a> be closed with respect to the XML
Query Data Model.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been met.</p><p>Both the input to a query and the output of a query
<a href="#terminology-must">MUST</a> be defined purely in terms of the
XML Query Data Model. Non-XML sources such as traditional databases or
objects may be queried if they are given an XML Query Data Model
representation. Similarly, query results are defined purely in terms of the
XML Query Data Model. In software systems these results may be instantiated
in any convenient representation such as DOM nodes, hyperlinks, XML text, or
various data formats.</p><p>
<img src="http://www.w3.org/Icons/green-ball.gif" alt="green status">
<em>Status:</em> this requirement has been
met.</p></dd></dl></div></div><div class="div1">
<h2><a name="relationships" id="relationships"></a>4 Relationship to Other Activities</h2><p>XML has become a strategic technology in W3C and in the global Web
market. The deliverable of the XML Query Working Group
<a href="#terminology-must">MUST</a> satisfy the dependencies from the
following Working Groups before it can advance to Proposed Recommendation.
Some dependencies to and from the following W3C Working Groups will require
close cooperation during the development process; the requirements posed for
the Query work by these Working Groups may change during the development
process, which means the interdependency of the Query work with these Working
Groups must be managed actively:</p><dl><dt class="label">W3C Document Object Model Working Group (DOM)</dt><dd><p>The XML Query Language must be able to return results in a form that can
be used in
<a href="http://www.w3.org/DOM/">DOM</a> programs, such as
<a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247">DOM
Nodes</a> or the Iterators and TreeWalkers defined in the
<a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html">Traversal</a>
specification.</p></dd><dt class="label">XSL and Linking Working Groups</dt><dd><p>Both
<a href="http://www.w3.org/TR/xslt">XSLT</a> and
<a href="http://www.w3.org/TR/WD-xptr">XPointer</a> use the XML Path
Language (
<a href="http://www.w3.org/TR/xpath">XPath</a>), which defines a
location path syntax that can be used to search for matching parts of an XML
document. The XML Query work will take into consideration the expressibility
and search facilities of XPath when formulating its algebra and query syntax,
and where desirable try to encompass those functionalities into its query
language. The XML Query WG will also take into consideration the additional
functionality in the XSLT and XPointer specifications.</p></dd><dt class="label">XML Schema Working Group</dt><dd><p>It is a goal of the XML Query work to be compatible with the work of the
<a href="http://www.w3.org/XML/Schema">XML Schema Working Group</a>,
including both
<a href="http://www.w3.org/TR/xmlschema-1/">Structures</a> and
<a href="http://www.w3.org/TR/xmlschema-2/">Datatypes</a>.</p><p>For example, it should be possible to base query predicates on the
existing DTD or XSDL definition of the content of an XML document and on the
new data types being defined as part of the XDTL.</p></dd><dt class="label">W3C XML Core Working Group</dt><dd><p>The XML Query work will define a formal data model of XML documents. This
model must be based on the model of the
<a href="http://www.w3.org/TR/xml-infoset/">XML Infoset</a>. In case
incompatibilities arise, requirements must be posed to the
<a href="http://www.w3.org/XML/Core/">W3C XML Core Working
Group</a>. In any case, the final model used by the XML Query working group
will have to be based on, and totally compatible with, the model of the XML
Infoset.</p></dd></dl><p>There are no requirements for co-development of features with the
following Working Groups, but there are points of contact between their work
and that of this Working Group, and thus logical dependency between their
deliverables and those of this Working Group. Requirements from these Working
Groups are expected to be well suited for communication via documents:</p><dl><dt class="label">WAI Protocols & Formats Working Group</dt><dd><p>Reuse of common constructs greatly facilitates accessibility; the
<a href="http://www.w3.org/WAI/PF/">WAI PF Working Group</a> will review
work on the XML query facilities to be sure cost/benefit design decisions are
informed of the benefits of accessibility.</p></dd><dt class="label">Internationalization Working Group</dt><dd><p>The XML Query Working Group will solicit feedback from the
<a href="http://www.w3.org/International/">Internationalization Working
Group</a> to ensure that it satisfies W3C goals for international access to
the Web.</p></dd><dt class="label">XML Fragments Working Group</dt><dd><p>It may be necessary for the XML Query Working Group to reference the
<a href="http://www.w3.org/TR/xml-fragment">XML Fragment</a>
specification if a valid query return type is an XML
fragment.</p></dd></dl><dl><dt class="label">IETF DASL Working Group</dt><dd><p>XML Query must strive for smooth interaction with the IETF
<a href="http://www.ics.uci.edu/pub/ietf/dasl/">DASL</a> (DAV Searching
& Locating) Working Group, in such a way that the XML query language can be
easily incorporated into the DASL protocol.</p></dd></dl><p>Formal liaison between the XML Query Working Group and other W3C working
groups, including the other XML working groups and the WAI (Web
Accessibility Initiative) group, as well as organizations outside of the W3C,
shall be accomplished by the exchange of documents (requirements, reviews,
etc.) transmitted through the XML Coordination Group.</p></div><div class="div1">
<h2><a name="d0e1169" id="d0e1169"></a>5 References (non-normative)</h2><p>The following references are some of the works considered by the WG in
deriving its requirements.</p><dl><dt class="label"><a name="QL98" id="QL98"></a>QL98</dt><dd>
<a href="http://www.w3.org/TandS/QL/QL98/">Query Languages'98
(QL'98)</a>, W3C, 1998.</dd><dt class="label"><a name="Maier98" id="Maier98"></a>Maier98</dt><dd>
<a href="http://www.w3.org/TandS/QL/QL98/pp/maier.html">Database Desiderata
for an XML Query Language</a>, David Maier, 1998. In
<a href="http://www.w3.org/TandS/QL/QL98/">Query Languages 98
(QL'98)</a>. (See http://www.w3.org/TandS/QL/QL98/pp/maier.html.)</dd><dt class="label"><a name="CM98" id="CM98"></a>CM98</dt><dd>
<a href="http://www.w3.org/TandS/QL/QL98/pp/queryreq.html">Candidate
Requirements for XML Query</a>, Paul Cotton and Ashok Malhotra, 1998. In
<a href="http://www.w3.org/TandS/QL/QL98/">Query Languages 98
(QL'98)</a>. (See http://www.w3.org/TandS/QL/QL98/pp/queryreq.html.)</dd><dt class="label"><a name="FSW9" id="FSW9"></a>FSW99</dt><dd>
<a href="http://www.w3.org/1999/09/ql/docs/xquery.html">XML Query
Languages: Experiences and Exemplars</a>, Mary Fernandez, Jerome Simeon,
Philip Wadler, 1999. (See http://www.w3.org/1999/09/ql/docs/xquery.html.)</dd><dt class="label"><a name="Robie99" id="Robie99"></a>Robie99</dt><dd>
<a href="http://www.w3.org/XML/Group/1999/10/xquery-tree.html">The Tree
Structure of XML Queries</a>, Jonathan Robie. (
<a href="http://cgi.w3.org/MemberAccess/AccessRequest">W3C members
only</a>). (See http://www.w3.org/XML/Group/1999/10/xquery-tree.html.)</dd><dt class="label"><a name="XML" id="XML"></a>XML</dt><dd>
<a href="http://www.w3.org/TR/REC-xml/">Extensible Markup Language (XML),
Version 1.0 (second edition)</a>. W3C Recommendation, 2000. (See http://www.w3.org/TR/1998/REC-xml-19980210.)</dd><dt class="label"><a name="XPath" id="XPath"></a>XPath</dt><dd>
<a href="http://www.w3.org/TR/xpath">XML Path Language (XPath), Version
1.0</a>. W3C Recommendation, 1999. (See http://www.w3.org/TR/xpath.)</dd><dt class="label"><a name="Namespaces" id="Namespaces"></a>Namespaces</dt><dd>
<a href="http://www.w3.org/TR/1999/REC-xml-names-19990114/">Namespaces in
XML</a>. W3C Recommendation, 1999. (See http://www.w3.org/TR/1999/REC-xml-names-19990114/.)</dd><dt class="label"><a name="DOM" id="DOM"></a>DOM</dt><dd>
<a href="http://www.w3.org/TR/DOM-Level-2-Core/">Document Object Model
(DOM), Level 2 Core Specification</a>. W3C Recommendation, 2000. (See http://www.w3.org/TR/1999/CR-DOM-Level-2-19991210.)</dd><dt class="label"><a name="XSLT" id="XSLT"></a>XSLT</dt><dd>
<a href="http://www.w3.org/TR/xslt">XSL Transformations (XSLT), Version
1.0</a>. W3C Recommendation, 1999. (See http://www.w3.org/TR/1999/REC-xslt-19991116.)</dd><dt class="label"><a name="Infoset" id="Infoset"></a>Infoset</dt><dd>
<a href="http://www.w3.org/TR/xml-infoset/">XML Information Set</a>, W3C
Recommendation, 2001. (See http://www.w3.org/TR/1999/CR-DOM-Level-2-19991210.)</dd><dt class="label"><a name="XMLSchema0" id="XMLSchema0"></a>XMLSchema0</dt><dd>
<a href="http://www.w3.org/TR/xmlschema-0/">XML Schema Part 0:
Primer</a>, W3C Recommendation, 2001. (See http://www.w3.org/TR/xmlschema-0/.)</dd><dt class="label"><a name="XMLSchema1" id="XMLSchema1"></a>XMLSchema1</dt><dd>
<a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1:
Structures</a>, W3C Recommendation, 2001. (See http://www.w3.org/TR/xmlschema-1/.)</dd><dt class="label"><a name="XMLSchema2" id="XMLSchema2"></a>XMLSchema2</dt><dd>
<a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2:
Datatypes</a>, W3C Recommendation, 2001. (See http://www.w3.org/TR/xmlschema-2/.)</dd><dt class="label"><a name="UpdateRequirements" id="UpdateRequirements"></a>Update Requirements</dt><dd>
<a href="http://www.w3.org/TR/xquery-update-requirements/">XQuery Update Facility Requirements</a>,
W3C Working Draft, Feb. 2005. (See http://www.w3.org/TR/xquery-update-requirements/.)</dd><dt class="label"><a name="FullTextRequirements" id="FullTextRequirements"></a>Full-Text Requirements</dt><dd>
<a href="http://www.w3.org/TR/xquery-full-text-requirements/">XQuery and XPath Full-Text Requirements</a>,
W3C Working Draft, May 2003. (See http://www.w3.org/TR/xquery-full-text-requirements/.)</dd></dl></div></div><div class="back"><div class="div1">
<h2><a name="d0e1268" id="d0e1268"></a>A Glossary</h2><dl><dt class="label">Universal and Existential Quantifiers</dt><dd><p>A quantifier is a term denoting a constraint on the number of objects in a
collection that satisfy an accompanying condition. The existential quantifier
denotes that at least one object satisfies the condition. The universal
quantifier denotes that all objects satisfy the condition.</p></dd><dt class="label">Document</dt><dd><p>A document consists of the set of nodes and edges in the subtree
descended from a Document node in the XML Query Data Model.</p></dd><dt class="label">Inter-document references</dt><dd><p>References that refer to nodes that do not reside in the same XML document
as the reference itself.</p></dd><dt class="label">Intra-document references</dt><dd><p>References that reside in the same XML document as the nodes they
reference.</p></dd><dt class="label">Literal Data</dt><dd><p>Literal fragments of an XML document such as
<name><first>Joe</first><last>Doe</last></name>, which may be
used for comparison.</p></dd></dl></div></div></body></html>