Network Working Group R J. Godoy
Internet-Draft H. Minni
Intended status: Experimental Universidad Nacional del Litoral
Expires: July 16, 2008 January 13, 2008
A WebDAV Search Grammar for XML Properties
draft-godoy-webdav-xmlsearch-00
Status of This Memo
By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
This Internet-Draft will expire on July 16, 2008.
Copyright Notice
Copyright (C) The IETF Trust (2008).
Abstract
This document specifies XS:xml-search, a search grammar for use with
the Web Distributed Authoring and Versioning (WebDAV) SEARCH
protocol. XS:xml-search extends the DAV:basicsearch grammar with
XPath expressions which are evaluated on properties whose values are
XML fragments.
The full expression power of XPath may exceed the requirement in
simple use cases, therefore some provisions are made in order to
Godoy & Minni Expires July 16, 2008 [Page 1]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
reduce the cost of implementing this specification, as well as the
computational cost of evaluating allowed queries.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Notational conventions . . . . . . . . . . . . . . . . . . 4
1.2. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4. XS:xml-search and the PROPFIND response . . . . . . . . . 7
2. XPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1. Static and Dynamic Contexts . . . . . . . . . . . . . . . 8
2.2. Error and warnings . . . . . . . . . . . . . . . . . . . . 10
2.2.1. Warnings . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.2. Errors (in SAP) . . . . . . . . . . . . . . . . . . . 10
2.2.3. Errors (in DEP) . . . . . . . . . . . . . . . . . . . 11
2.3. Numeric Predicates . . . . . . . . . . . . . . . . . . . . 12
3. Discovery of the Query Grammar . . . . . . . . . . . . . . . . 13
3.1. The DASL Response Header . . . . . . . . . . . . . . . . . 13
3.2. DAV:supported-query-grammar-set . . . . . . . . . . . . . 13
3.3. Discovery of the XS:xml-search Query Schema . . . . . . . 13
4. The XS:xml-search Grammar . . . . . . . . . . . . . . . . . . 15
4.1. Accepted Role Precondition . . . . . . . . . . . . . . . . 15
4.2. Selection . . . . . . . . . . . . . . . . . . . . . . . . 16
4.3. Query criteria . . . . . . . . . . . . . . . . . . . . . . 18
4.3.1. DAV:prop operand . . . . . . . . . . . . . . . . . . . 18
4.3.2. Literal Operands . . . . . . . . . . . . . . . . . . . 19
4.3.3. Relational operators . . . . . . . . . . . . . . . . . 19
4.3.4. The XS:filter operator . . . . . . . . . . . . . . . . 20
4.3.5. The XS:is-well-formed operator . . . . . . . . . . . . 20
4.4. Ordering . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.5. SEARCH Status Codes for responses to XS:xml-search
queries . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.6. Status Codes for Use in 'response' Elements . . . . . . . 21
4.7. Status Codes for Use in 'propstat' Elements . . . . . . . 22
4.8. Precondition and postcondition Codes . . . . . . . . . . . 22
4.8.1. XS:property-must-be-well-formed-xml . . . . . . . . . 22
4.8.2. XS:acceptable-role . . . . . . . . . . . . . . . . . . 22
4.8.3. XS:XPath-error . . . . . . . . . . . . . . . . . . . . 23
4.8.4. DAV:search-scope-valid . . . . . . . . . . . . . . . . 23
4.8.5. XS:known-literal-type . . . . . . . . . . . . . . . . 23
5. Query Schema for XS:xml-search . . . . . . . . . . . . . . . . 23
5.1. Property descriptions . . . . . . . . . . . . . . . . . . 24
5.2. Operator descriptions . . . . . . . . . . . . . . . . . . 25
5.2.1. XS:opdesc-rule and XS:operator . . . . . . . . . . . . 26
5.2.2. XS:repetition . . . . . . . . . . . . . . . . . . . . 27
5.2.3. XS:alternative . . . . . . . . . . . . . . . . . . . . 27
5.2.4. Implied operator description . . . . . . . . . . . . . 27
Godoy & Minni Expires July 16, 2008 [Page 2]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
5.2.5. Extended operator description for
DAV:typed-literal Operand . . . . . . . . . . . . . . 29
6. XML Extensibility . . . . . . . . . . . . . . . . . . . . . . 30
7. Security Considerations . . . . . . . . . . . . . . . . . . . 31
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 31
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.1. Normative References . . . . . . . . . . . . . . . . . . . 31
9.2. Informative References . . . . . . . . . . . . . . . . . . 33
Editorial Comments . . . . . . . . . . . . . . . . . . . . . . . . 33
Appendix A. Example XS:xml-search query . . . . . . . . . . . . . 35
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Godoy & Minni Expires July 16, 2008 [Page 3]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
1. Introduction
This document specifies XS:xml-search, an OPTIONAL search grammar for
use with the Web Distributed Authoring and Versioning (WebDAV) SEARCH
protocol. The search grammar defined by this document is a superset
of DAV:basicsearch [I-D.reschke-webdav-search].
The intent of this document is to extend the DAV:basicsearch grammar
for dealing with properties whose values are XML fragments. Since
the WebDAV property namespace is flat, and resources may have at most
one value for a property of a given name (Section 9.1 of [RFC4918]),
XML documents allowing repeatable elements cannot be expressed as a
set of independent WebDAV properties (i.e by mapping some elements to
properties), and the DAV:basicsearch schema cannot be applied to such
XML content because it deals with property values as a whole. [note-
intent]
XS:xml-search is proposed as a different search grammar because it
defines a new element (namely XS:filter) that modify the query
semantics. Had this been an extension of DAV:basicsearch, a server
would have ignored the XS:filter elements (according to Section 17 of
[RFC4918]) yielding results different from those requested by the
client. [note-RFC4918-sect17]
1.1. Notational conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
This specification defines elements in the
urn:ietf:params:xml:ns:webdav-xml-search XML namespace. (hereinafter
referred to as the "XS namespace", though the prefix binding "XS:" is
not normative). In natural language, an element like "xml-search" in
this namespace is sometimes referred to as "XS:xml-search" (without
quotes). [note-namespace].
In element definitions, an element name prefixed with "XS:" refers to
an element in the XS namespace, and un-prefixed element names refers
to elements in the "DAV:" namespace.
The DTD fragments are normative up to extensibility rules defined in
Section 6. Unless noted otherwise, ordering of declared content is
not significative.
Note: when an error condition is described, it is said that "the
server MUST return" some indication of that error. Unless stated
otherwise, if several errors occurs at the same time, any of them MAY
Godoy & Minni Expires July 16, 2008 [Page 4]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
be reported and any of them MAY be omitted as long as one of them is
reported.
1.2. Terms
This document uses the terms defined in [RFC2616], [RFC4918],
[W3C.PR-xpath20-20061121] and this section. Some definitions of
frequently used terms from [W3C.PR-xpath20-20061121] are
informatively included here.
Dynamic Context: (of an XPath expression) "the dynamic context of an
expression is defined as information that is available at the time
the expression is evaluated." (Section 2.1.2,
[W3C.PR-xpath20-20061121])
Dynamic Evaluation Phase (DEP): "The dynamic evaluation phase is the
phase during which the value of an expression is computed. It occurs
after completion of the static analysis phase." (Section 2.3.3.2,
[W3C.PR-xpath20-20061121])
Dynamic Error: "A dynamic error is an error that must be detected
during the dynamic evaluation phase and may be detected during the
static analysis phase. Numeric overflow is an example of a dynamic
error." (Section 2.3.1, [W3C.PR-xpath20-20061121])
Implementation-defined: "indicates an aspect that MAY differ between
implementations, but MUST be specified by the implementor for each
particular implementation." (Section 1, [W3C.PR-xpath20-20061121])
Implementation-dependent: "indicates an aspect that MAY differ
between implementations, is not specified by [this or any other]
specification, and is not required to be specified by the implementor
for any particular implementation." (Section 1,
[W3C.PR-xpath20-20061121])
Role: a context within XS:xml-search where the DAV:prop element is
expected. A role is "plain" if the DAV:prop element occurs as a
direct child of DAV:select, DAV:where, or DAV:order, and it is
"filtered" (also referred as XPath-enabled) if the DAV:prop element
occurs as a direct child of XS:XPath.
Static Analysis Phase (SAP): "The static analysis phase depends on
the expression itself and on the static context. The static analysis
phase does not depend on input data (other than schemas)." (Section
2.3.3.1, [W3C.PR-xpath20-20061121])
Static Context: (of an XPath expression) "the static context of an
expression is the information that is available during static
Godoy & Minni Expires July 16, 2008 [Page 5]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
analysis of the expression, prior to its evaluation." (Section
2.1.1, [W3C.PR-xpath20-20061121])
Static Error: "A static error is an error that MUST be detected
during the static analysis phase. A syntax error is an example of a
static error." (Section 2.3.1, [W3C.PR-xpath20-20061121])
Type Error: "A type error may be raised during the static analysis
phase or the dynamic evaluation phase. During the static analysis
phase, a type error occurs when the static type of an expression does
not match the expected type of the context in which the expression
occurs. During the dynamic evaluation phase, a type error occurs
when the dynamic type of a value does not match the expected type of
the context in which the value occurs." (Section 2.3.1,
[W3C.PR-xpath20-20061121])
1.3. Overview
Section 1.4 summarizes how this query grammar matches the PROPFIND
response, according to the requirement imposed by Section 2.3.2 of
[I-D.reschke-webdav-search].
Section 2 describes XS:xml-search as an XPath host language, i.e., a
language where XPath expressions are embedded. Some items from the
XPath specification are defined in that section, while other are left
to the criteria of the implementors. This section also includes
design decisions in order to reduce the implementation cost of this
specification, as well as the computational cost of allowed queries.
Section 3 describes how this grammar is advertised, according to the
mechanisms for discovery of supported query grammars, defined in
Section 3 of [I-D.reschke-webdav-search]. This include the Allow and
DASL headers in OPTIONS responses (Section 3.1), the DAV:supported-
query-grammar-set property (Section 3.2) and Query Schema Discovery
(Section 3.3 and Section 5).
Section 4 describes the grammar of a XS:xml-search query. This
includes extending the specification of selection (Section 4.2) query
criteria (Section 4.3) and ordering (Section 4.4) with respect to
DAV:basicsearch. Additionally, some status (Section 4.5 to
Section 4.7) and precondition/postcondition codes (Section 4.8) are
defined.
Section 5 describes the Query Schema for advertising supported
features about properties (Section 5.1) and operators (Section 5.2)
available in a XS:xml-search query.
Section 6 describes the specified behaviour when unexpected elements
Godoy & Minni Expires July 16, 2008 [Page 6]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
are found, providing a common ground for allowing clients that
implement arbitrary extensions to interoperate with other
implementations which does not include it.
1.4. XS:xml-search and the PROPFIND response
A XS:xml-search response describes a subset of the elements which are
described by a PROPFIND response that lists the same properties on
the same scope and with the same depth. If a server supports
specifying several scopes in a single query, and these scopes exist,
then the XS:xml-search response will describe a subset of the
elements in several PROPFIND responses (one PROPFIND for each scope).
The properties included in a XS:xml-search response are those
specified within the DAV:select element of the request. In that
context, DAV:allprop and DAV:prop are understood as in PROPFIND,
hence both methods returns the same properties. In addition, XS:xml-
search introduce a new way for selecting properties: XS:filter, which
"filters" elements from some property value according to an XPath
expression. If XS:filter is used, the XS:xml-search response will
contain a subset of elements from the filtered property, while the
PROPFIND response will contain the complete value.
Queries may impose conditions about which or how many resources will
be included in the response, and servers may truncate the response at
their choice. Thus, a SEARCH response may not include some resources
from the specified scope, while all of them have to be included when
using PROPFIND.
Furthermore, XS:xml-search defines additional preconditions and
postconditions codes that are not used with a PROPFIND response.
2. XPath
There are several items in XPath that are implementation-defined.
Some of them are defined in this section (as this protocol specifies
an XPath host language) while other are left to the criteria of the
implementors.
* Some components of the static and dynamic contexts are constrained
(Section 2.1).
* A way for reporting errors and warnings is specified (Section 2.2).
* In some expressions, supporting numeric predicates is OPTIONAL
(section Section 2.3).
* Implementations of this protocol MUST be based on the rules of
Godoy & Minni Expires July 16, 2008 [Page 7]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
[W3C.REC-xml11-20060816] and [W3C.REC-xml-names11-20060816], and
apply them consistently.
* The self, child, and attribute axes MUST be supported. An
implementation MAY support other axes, as described in the query
schema. (Note: the abbreviated steps ".." and "//" are not
supported, unless the parent and descendant-or-self axes respectively
are supported.)
* Support for the "Static Typing Feature" and "Static Typing
Extensions" (Appendix F.1 of [W3C.PR-xpath20-20061121]) is
implementation-defined.
2.1. Static and Dynamic Contexts
This specification defines REQUIRED values for some components of the
XPath static and dynamic context. Unless specified otherwise, the
constant values specified below MUST NOT be overwritten. Components
not listed here are "implementation-dependent".
Evaluation of an expression that relies on one or more "unassigned"
components raises the static error err:XPST0001 (if the component is
static) or the dynamic error err:XPDY0002 (if the component is
dynamic).
REQUIRED static values
+---------------------+---------------------------------------------+
| Component | Specified Value |
+---------------------+---------------------------------------------+
| XPath 1.0 | "false". |
| compatibility mode | |
| | |
| Statically known | All the namespace bindings in scope at the |
| namespaces | XS:XPath element where the expression |
| | occurs plus ("fn:", |
| | "http://www.w3.org/2005/ XPath- functions") |
| | unless overwritten. |
| | |
| Default | The default namespace of the XS:XPath |
| element/type | element where the expression occurs ("none" |
| namespace | if there is no default namespace). |
| | |
| Default function | None. |
| namespace | |
| | |
| Function signatures | None (may be overwritten). |
| | |
Godoy & Minni Expires July 16, 2008 [Page 8]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
| Statically known | At least |
| collations | "http://www.iana.org/assignments/collation/ |
| | default" and applicable wildcard collations |
| | (Sections 3.1 and 3.2 of [RFC4790]). MAY |
| | be augmented with an implementation-defined |
| | set of collations. |
| | |
| Default collation | The collation matched by |
| | "http://www.iana.org/assignments/collation/ |
| | default" (the actual collation is |
| | implementation-defined) |
| | |
| Base URI | Unassigned. |
| | |
| Statically known | Initially unassigned. Overwriteable with |
| documents | an implementation-defined value. |
| | |
| Statically known | Initially unassigned. Overwriteable with |
| collections | an implementation-defined value. |
| | |
| Statically known | node()* |
| default collection | |
| type | |
+---------------------+---------------------------------------------+
REQUIRED dynamic values
+------------------+------------------------------------------------+
| Component | Specified Value |
+------------------+------------------------------------------------+
| Function | Implementation-defined, MUST be consistent |
| implementations | with function signatures. |
| | |
| Current dateTime | REQUIRED implementation-dependent value. |
| | |
| Implicit | REQUIRED implementation-defined value. |
| timezone | |
| | |
| Available | Initially unassigned. Overwriteable with an |
| documents | implementation-defined value. |
| | |
| Available | Initially unassigned. Overwriteable with an |
| collections | implementation-defined value. |
| | |
| Default | Initially unassigned. Overwriteable with an |
| collection | implementation-defined value. |
+------------------+------------------------------------------------+
Godoy & Minni Expires July 16, 2008 [Page 9]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
2.2. Error and warnings
This section describes the method by which XPath errors and warnings
are reported. Error conditions are defined in
[W3C.PR-xpath20-20061121], and warning conditions are OPTIONAL and
implementation-defined.
For conformance with [W3C.PR-xpath20-20061121], implementations MAY
report any non-empty subset of errors. Additionally, if there is an
error (other than a XPath error) that causes the request to be
rejected, implementations MAY report the latter, with no mention to
the XPath errors.
The idref attributes of XS:xpath-error and XS:warning MAY be used to
refer to the id attribute of the XS:xpath element whose content
raised the error or warning. The mechanism that implementations use
to return additional information is implementation-defined.
2.2.1. Warnings
The XS:warning element contains at least one XML element, and MUST
NOT contain text or mixed content. Children of the XS:warning
element represent warnings signaled during the analysis of the
expression.
The DAV:multistatus and DAV:response elements, when used in response
to XS:xml-search queries, are modified to include an OPTIONAL XS:
warning element. Warnings raised during SAP apply to the whole query
and are reported within the XS:warning element contained by DAV:
multistatus. Warnings raised during DEP only apply to a particular
resource and are reported within the DAV:response for that resource.
The XS:xpath-error element MUST contain one or more elements
describing the error. For instance, if an err:XPST0003 were raised
(i.e. the XPath static error 0003: "a XPath expression is not a valid
instance of the grammar") the response would be:
HTTP/1.1 400 Bad Request
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx
(Note: the use of the "err:" prefix follows the convention of
[W3C.PR-xpath20-20061121] but it is not normative.)
2.2.3. Errors (in DEP)
An expression may be statically valid and raise an error under some
dynamic conditions. Dynamic and type errors detected during DEP only
invalidates the expression which raises them, when evaluated with the
actual values of some resource property.
A server MAY ignore errors detected in DEP if:
-The error occurs within DAV:order, but that ordering criteria is
not used (because other orders take precedence, or because the query
matches one or no resource).
-The error occurs within DAV:where part, and it does not affect
the result. For instance, the error in (FALSE AND ERROR) may be
omitted because the result would have been FALSE anyway, and the
error in (TRUE OR ERROR) may be omitted because the result would have
been TRUE anyway.
If the error is not ignored, and the XPath expression was specified
within the DAV:select part, it MAY be reported in the DAV:propstat
element for the current property and resource. Otherwise it MAY be
reported in the DAV:response element for the current resource. In
both cases the status code 409 (Conflict) MUST be used.
Godoy & Minni Expires July 16, 2008 [Page 11]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
Although errors in DEP depend on the value of the property, an error
that is too frequent might have been caused by mistakes in the
client's request. Therefore, instead of returning a sequence of DAV:
response elements, all of which represent failures because of the
same error, a server MAY report an error in DEP as a general failure
invalidating the query itself, even if it is possible to evaluate
other resources and properties. [error-DEP]
When an error raised in DEP is reported as a general failure, the
response will be marshaled as in Section 2.2.2, but the response
status code MUST be 409 (Conflict) instead of 400 (Bad Request).
For instance, if err:XPTY0004 were raised during DEP ("the dynamic
type of a value does not match a required type"), the response would
be:
HTTP/1.1 409 Conflict
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx
the dynamic type of a value does not match a required type
2.3. Numeric Predicates
"A step is a part of a path expression that generates a sequence of
items and then filters the sequence by zero or more predicates."
(Section 3.2.1 of [W3C.PR-xpath20-20061121]). A step expression may
be either a FilterExpr or an AxisExpr.
"A predicate consists of an expression, called a predicate
expression, enclosed in square brackets. A predicate serves to
filter a sequence, retaining some items and discarding others."
(Section 3.2.2 of [W3C.PR-xpath20-20061121])
Support for numeric predicates and other references to the context
position -e.g. by evaluating the fn:position() function- depends on
the sequence where the predicate applies.
Supporting numeric predicates in FilterExpr is OPTIONAL. If the step
expression is an AxisStep, the requirement level depends on the
specified axis. It is:
Godoy & Minni Expires July 16, 2008 [Page 12]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
* NOT RECOMMENDED for the namespace and attribute axes, because the
relative order of elements within these axes is implementation-
dependent.
* Always REQUIRED for the parent, self, and ancestor axes.
* For the child, preceding-sibling and following-sibling axes:
RECOMMENDED if the sequence order is semantically meaningful,
OPTIONAL otherwise.
* Always OPTIONAL for the descendant, descendant-or-self, ancestor-
or-self, preceding, and following axes.
[note-context-position]
The way this feature is supported when it is not REQUIRED is
implementation-dependent.
3. Discovery of the Query Grammar
If a resource supports the SEARCH method, then the server MUST list
SEARCH in the Allow header, as described in Section 3.1 of
[I-D.reschke-webdav-search].
3.1. The DASL Response Header
The DASL response header indicates server support for a query grammar
in the OPTIONS method. (Section 3.2 of [I-D.reschke-webdav-search])
The value of this header is a URI that indicates the type of grammar
supported. Servers MUST return the following header when the OPTIONS
method is invoked on any arbiter that supports the XS:xml-search
grammar:
DASL:
3.2. DAV:supported-query-grammar-set
The WebDAV property DAV:supported-query-grammar-set is REQUIRED for
any server supporting either [RFC3253] and/or [RFC3744] and
identifies the XML based query grammars that are supported by the
search arbiter resource (Section 3.3 of [I-D.reschke-webdav-search]).
Servers implementing DAV:supported-query-grammar-set MUST report the
following grammar for each arbiter resource supporting XS:xml-search:
3.3. Discovery of the XS:xml-search Query Schema
Query Schema Discovery (QSD) is requested by means of the SEARCH
Godoy & Minni Expires July 16, 2008 [Page 13]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
method, including an entity with a DAV:query-schema-discovery root
element. As specified in Section 4.1 of [I-D.reschke-webdav-search],
the response body takes the form of a DAV:multistatus element
(Section 13 of [RFC4918]), where DAV:response is extended to hold the
returned query grammar inside a DAV:query-schema container element.
If the DAV:query-schema-discovery element contains XS:xml-search,
then the response marshaling MUST be performed as described in this
section and Section 5.
Since the supported query grammars may depend on the scope, the XS:
xml-search element (when used for QSD) MAY contain a DAV:from
element. Other content is unexpected in this context.
If several scopes are specified and the server supports multiple
scopes, then the response MUST only contain those descriptions that
are common to each scope.
Request:
SEARCH / HTTP/1.1
Host: host.example
Content-Type: application/xml
Content-Length: xxx
Response:
HTTP/1.1 207 Multistatus
Content-Type: application/xml
Content-Length: xxx
http://host.exampleHTTP/1.1 200 OK
Godoy & Minni Expires July 16, 2008 [Page 14]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
4. The XS:xml-search Grammar
The elements used in XS:xml-search conform the semantics given in
[I-D.reschke-webdav-search] for the DAV:basicsearch grammar, and all
the operators defined in Section 5 of [I-D.reschke-webdav-search]
(i.e. %all_ops;) are valid in the context of a XS:xml-search query.
Additionally, some elements in the "DAV:" namespace are allowed to
contain specific elements from the XS:xml-search grammar.
Therefore, the semantics of a DAV:basicsearch valid query is
preserved when the DAV:basicsearch content is submitted as a XS:xml-
search query.
This grammar also allows the additional element XS:filter as well as
optional implementation-defined operators. The XS:filter element
specifies an XPath expression (rooted on a single property, i.e. the
root element is the property whose name is included in the DAV:prop
element). It is both a query-operator and a special construct valid
within DAV:select and DAV:order elements.
//foo
Godoy & Minni Expires July 16, 2008 [Page 17]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
If DAV:allprop is specified, it is understood as in a PROPFIND
request [RFC4918]: (i.e., properties defined in RFC 4918, at a
minimum, plus dead properties MUST be returned). Hence, the set of
properties selected by allprop vary from resource to resource.
If the request includes not only DAV:allprop but also one or more
DAV:prop elements specifying properties which are already returned
per DAV:allprop, or the request includes a property twice in DAV:prop
elements, then the redundant properties MUST be ignored (i.e. a
single property value will be returned). This behaviour is similar
to that of the DAV:include element in a PROPFIND request (but DAV:
include is not defined for XS:xml-search requests).
There is no error when a property that would be returned per DAV:
allprop is also specified within a XS:filter element (since the
client may not be aware of the properties that will be returned when
DAV:allprop is specified). This combination MUST be addressed as
follows:
- The XS:filter elements are processed as usual. This result in
properties contained in DAV:propstat; elements with status code 200,
4xx or 5xx (as appropriate).
- Each property that would have been returned per DAV:allprop in
a PROPFIND request and was not included within a XS:filter element,
is selected.
4.3. Query criteria
The DAV:where element specifies optional query criteria. Only those
resources that verify the query criteria are included in the result
set.
4.3.1. DAV:prop operand
The result of the DAV:prop operand is the value of the specified
property of the resource being evaluated. If the property is a live
one, the result datatype SHOULD be the actual property datatype. If
the property is dead, or the server chooses to ignore the live
property datatype, the result MUST be of type xs:string.
Note: "A property name is a universally unique identifier that is
associated with a schema that provides information about the syntax
and semantics of the property." (Section 4.4 of [RFC4918]).
Therefore, each property name SHOULD be permanently associated with
at most one datatype.
Godoy & Minni Expires July 16, 2008 [Page 18]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
4.3.2. Literal Operands
DAV:literal and DAV:typed-literal allow literal values to be placed
in an expression.
When used with the operators defined in [I-D.reschke-webdav-search]:
- The type of a DAV:literal value MUST be the type of the other
operand in the expression.
- The type of a DAV:typed-literal value MUST be the type specified
in the xsi:type attribute, or xs:string if no type was specified.
The value of the other operand MUST be casted to this type.
A request with a DAV:typed-literal specifying an unknown type MUST be
rejected by returning a response with status code 422 (Unprocessable
Entity) and precondition code XS:known-literal-type. The xs:string
type MUST NOT be unknown.
4.3.3. Relational operators
The relational operators take a property and literal operand. XS:
xml-search inherits the five relational operators defined in
[I-D.reschke-webdav-search]: DAV:eq, DAV:lt, DAV:gt, DAV:lte and DAV:
gte.
For each property and pair of values being compared:
- per Section 4.2.1 of [W3C.REC-xmlschema-2-20041028] the result
of DAV:eq; is always defined, then DAV:eq; MUST NOT return NULL.
- all of DAV:lt, DAV:gt, DAV:lte and DAV:gte MUST be either
undefined or consistently defined. If they are defined, they MUST
also conform the result of DAV:eq (i.e., A == B iff A<=B and A>=B).
If the property type is known and it is a complex type, the result of
these operations SHOULD be undefined. [note-comparison-complex-type]
(Values within such properties may be compared by means of XPath
predicates.)
If the property type is known and it is a simple built-in ordered
type, the order relation used in the comparison SHOULD be that
defined in [W3C.REC-xmlschema-2-20041028].
If the property type is known and it is a simple type, an
implementation-dependent order relation MAY be used. If a partial
order is used, then trying to compare two values which are not
comparable yields an undefined result.
In any case, the collation algorithm is implementation-dependent.
Other operators and operands retain the behaviours defined in
Godoy & Minni Expires July 16, 2008 [Page 19]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
[I-D.reschke-webdav-search].
4.3.4. The XS:filter operator
When used inside a DAV:where element (or a sub-element thereof) XS:
filter evaluates as:
- TRUE if (and only if) the XPath expression matches at least one
element,
- FALSE if (and only if) no element within the property is
matched,
- NULL if (and only if) the property does not exist or its value
is not a well-formed XML fragment.
4.3.5. The XS:is-well-formed operator
The XS:is-well-formed operator takes a DAV:prop operand and returns:
- TRUE if (and only if) the property value is a well formed XML
fragment.
- FALSE if (and only if) the property value is not a well formed
XML fragment.
- NULL if (and only if) the property does not exist.
Supporting this operator is REQUIRED for properties which are XS:
searchable, and OPTIONAL for properties which are only DAV:
searchable.
4.4. Ordering
DAV:orderby specifies a lexicographical order on the set of DAV:
response to be returned. Comparisons are applied as they occur in
the DAV:orderby element, earlier comparisons being more significant
(Section 5.6 of [I-D.reschke-webdav-search]).
When used within XS:xml-search, a DAV:orderby element MUST contain
one or more DAV:order elements, which are allowed to contain a DAV:
prop, a DAV:score or a XS:filter elements.
When DAV:order contains a DAV:prop element, the ascending
(alternatively, descending) order MUST be consistent with the
comparison performed by DAV:lte (alternatively, DAV:gte):
- If A<=B (alternatively, A>=B) according to DAV:lte, then A collates
before B.
- If A<=B (alternatively, A>=B) is undefined, then the collation
order is implementation-dependent.
When DAV:order contains a DAV:score element, an integer comparison is
performed on each DAV:score value computed for the DAV:contains
operation.
Godoy & Minni Expires July 16, 2008 [Page 20]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
When DAV:order contains a XS:filter element, result-sets will be
logically partitioned in three equivalence classes, based on the
evaluation of XS:filter (as defined in Section 4.3). The equivalence
classes are totally ordered (in ascending order) as: NULL < false <
true.
Ordering within each equivalence class (i.e. ordering among all the
responses for which the XS:filter element evaluates to the same
value) is implementation-dependent. (The order specified for the
item-type in the sequence returned by the xpath expression MAY be
used.)
4.5. SEARCH Status Codes for responses to XS:xml-search queries
- 207 (Multistatus) The server accepted the request. The result
set are returned within a DAV:multistatus; element.
- 400 (Bad Request) Error in SAP, or the query includes both a
plain DAV:prop and a XS:filter specifying the same property name.
- 403 (Forbidden) The server rejected the request because the user
has no privileges for performing queries under the specified arbiter
resource.
- 404 (Not found) The arbiter resource does not exist.
- 409 (Conflict) Error in DEP (general failure) or invalid scope.
- 422 (Unprocessable Entity)
A property was specified in a role which is rejected for that
property.
An unknown type was specified in DAV:typed-literal.
A required extension is not supported.
Other status codes may be returned (redirections, client errors,
server errors), with the meaning defined in [RFC2616].
The 207 status code MUST be used if and only if a result set is
included in the response (an empty result set is allowed if the query
does not match any resource).
If the query could not be performed because of several errors, the
error which is reported is implementation-dependent.
If the client has no privileges for testing whether the arbiter
exists then 403 (Forbidden) SHOULD be used instead of 404 (Not
found). If the client has no privileges for accessing the specified
scope then 409 (Conflict) MUST be returned
4.6. Status Codes for Use in 'response' Elements
- 204 (No Content) if the resource exists and no selection list
was specified (i.e. the DAV:select element is empty).
Godoy & Minni Expires July 16, 2008 [Page 21]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
- 209 (Conflict) Error in DEP. The search was invalidated for
resources identified by DAV:href elements in the response.
If a selection list was specified, the response MUST NOT contain a
DAV:status element, but a DAV:propstat listing the selected
properties.
If the client has no privileges for testing whether a resource
exists, that resource MUST be silently omitted from the response.
5xx status codes MAY be used if a error occurs when accessing the
resource.
4.7. Status Codes for Use in 'propstat' Elements
- 200 (OK) for each selected property, if the property exists.
- 403 (Forbidden) if the client has no privileges for accessing
the selected property.
- 404 (Not Found) for each property selected through DAV:allprop,
DAV:prop or XS:filter if the property does not exist (OPTIONAL).
- 409 (Conflict) if a property specified in a selection XS:filter
element does not contains well-formed XML. The associated
postcondition MUST be XS:property-must-be-well-formed-xml.
If the client has no privileges for testing whether the property
exists, the server SHOULD either omit the property or return a 404
(Not found) status code (instead of 403).
5xx status codes MAY be used if a error occurs when accessing the
property value.
4.8. Precondition and postcondition Codes
4.8.1. XS:property-must-be-well-formed-xml
Type: postcondition
Use with: /multistatus/response/propstat/error, 409 Conflict
Purpose: the actual property value does not contain a well-formed XML
fragment, and the property was specified in a XS:filter element.
4.8.2. XS:acceptable-role
Type: precondition
Godoy & Minni Expires July 16, 2008 [Page 22]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
Use with: /error, 422 Unprocessable Entity
Purpose: the XS:xml-search request includes a property for a role
where it is not acceptable.
4.8.3. XS:XPath-error
Type: precondition/postcondition
Use with:
/error, 400 Bad Request (precondition)
/error, 409 Conflict (precondition)
/multistatus/response/error, 409 Conflict (postcondition)
/multistatus/response/propstat/error, 409 Conflict (postcondition)
Purpose: The query includes an XPath expression that raises an error.
(see Section 2.2.)
4.8.4. DAV:search-scope-valid
Type: precondition
Use with: /error, 409 Conflict
Defined in [I-D.reschke-webdav-search]
4.8.5. XS:known-literal-type
Type: precondition
Use with: /error, 422 Unprocessable Entity
Purpose: The query includes a DAV:typed-literal which specifies an
unknown data-type. The data-type name is included into the element
content.
5. Query Schema for XS:xml-search
The query schema provides information about the set of available
properties and implemented operators.
Godoy & Minni Expires July 16, 2008 [Page 23]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
The query schema is marshaled within a XS:xml-search-schema element.
This element contains an unordered set of property descriptions (DAV:
propdesc) and operator description rules (XS:opdesc-rule).
5.1. Property descriptions
The semantics of DAV:propdesc, when used within a XS:xml-search-
schema is extended for describing whether a property may be used as
root element of a XPath expression within a XS:filter element.
Since XS:filter may appear in three different places (the record-set
definition, the query criteria and the ordering criteria), the server
may allow or disallow it on a separate basis. If XS:selectable, XS:
searchable or XS:sortable is present, then the server MUST allow this
property to be used within a XS:filter element in the applicable
context (role)
Properties which are XS:selectable or XS:searchable are also DAV:
selectable or DAV:searchable respectively. For instance, if a
property may be selected through a XPath expression then it is
plainly selectable, and if a property may be used within a XS:filter
query criterion then it may be used as an operand of DAV:is-defined,
DAV:is-well-formed.
Properties which are XS:sortable are not DAV:sortable, because
comparison of complex types is undefined. Properties MUST NOT be
DAV:sortable and XS:sortable at the same time.
Godoy & Minni Expires July 16, 2008 [Page 24]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
The server MUST allow described properties to be used in the role for
which they were advertised. This hint does not assert whether the
property is defined on every resource in the scope, and does not
assert whether the property value is well-formed XML.
There SHOULD be one description for DAV:any-other-property. There
MUST NOT be more than one description for each property, and one
description for DAV:any-other-property.
The "name" attribute of the XS:axis element specifies the name of an
optional axis which is supported for the property being described.
5.2. Operator descriptions
Operators are described in a way that borrows some elements from ABNF
[RFC4234] (namely repetitions and alternatives). This approach
allows a flexible and compact description of operators. [note-opdesc]
5.2.1. XS:opdesc-rule and XS:operator
Godoy & Minni Expires July 16, 2008 [Page 25]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
XS:operator references the name of an operator. Several operators
may be defined by the same XS:opdesc-rule, and several XS:opdesc-rule
may define incremental alternatives (that is, an initial rule may
match one or more alternatives, with later rule definitions adding to
the set of alternatives, as in the ABNF construction Rule1 =/ Rule2
defined in section 3.3 of [RFC4234]).
For instance,
is equivalent to
Mandatory operators SHOULD be omitted from the actual schema returned
by a server (since their grammar is implied). If an operator is
defined or enhanced by an extension of this protocol, the server MUST
Godoy & Minni Expires July 16, 2008 [Page 26]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
return rules (i.e. one or more XS:opdesc-rule elements) for them. If
the enhanced operator is a mandatory one, then the alternative rule
applies. Hence, if the response includes
it means that the DAV:eq operator accepts a pair of (property, foo:
bar) operands, as well as it accepts the above-defined (property,
literal) and (property, typed-literal) alternatives (from the
implicit grammar).
The order in which operands are described is significant, because the
ordering of operands within a expression is significant.
5.2.2. XS:repetition
The semantics of element XS:repetition is similar to the ABNF
Variable Repetition (e.g: *Rule) defined in Section 3.6 of [RFC4234].
The optional attributes "atleast" and "atmost" indicates minimum and
maximum allowed occurrences of the described content.
Default values are atleast="0" and atmost="infinity" so that allows any number of occurrences, including zero; requires at least one, with no upper limit;
allows exactly 3 and allows one or two.
5.2.3. XS:alternative
The semantics of element XS:alternative is similar to the ABNF
Alternatives (e.g: Rule1 / Rule2) defined in Section 3.2 of
[RFC4234].
For instance, will accept either an operand-
typed-literal or an operand-literal but not both.
5.2.4. Implied operator description
The following query schema describes the operators specified in this
document, as well as the operators from [I-D.reschke-webdav-search],
as they would be reported in a QSD response.
Godoy & Minni Expires July 16, 2008 [Page 27]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
This description is implied, i.e. servers SHOULD NOT include it in
the response because these operators with these signatures are
mandatory.
Godoy & Minni Expires July 16, 2008 [Page 28]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
The DAV:is-collection operator is supported because XS:xml-search
extends DAV:basicsearch grammar. It can be expressed by using XS:
filter as:
/collection
Tests for other resource types, as well as test for no resource type
may be expressed by the XS:filter operator (provided that DAV:
resourcetype is XS:searchable). For instance, testing whether a
resource has no resource type may be expressed as:
count(/*)==0
5.2.5. Extended operator description for DAV:typed-literal Operand
The DAV:eq, DAV:gt, DAV:lt, DAV:lte, and DAV:gte operators MAY accept
a DAV:typed-literal operand, instead of DAV:literal. This
alternative is not implied (i.e. if supported, it MUST be included in
the QSD response). If DAV:typed-literal were supported (as defined
in [I-D.reschke-webdav-search]), the QSD response would include the
following rule:
5.2.5.1. Description of DAV:like Operator
If the DAV:like operator is supported (as described in Section 5.2.2
of [I-D.reschke-webdav-search], the following rule MUST be included
in the QSD:
Godoy & Minni Expires July 16, 2008 [Page 29]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
6. XML Extensibility
The extensibility mechanism from Section 17 of [RFC4918] (i.e., to
process received XML documents as if unexpected elements and
attributes, and all children of unrecognized elements, were not
present) may be inappropriate when dealing with queries because they
would not be evaluated as specified by the client (e.g. the query
criteria may be loosen or the result record or may be incomplete).
The omission of unexpected content might not be realized by the
client.
The extension attribute provides a mean for distinguishing whether
the extension was recognized or ignored, raising a precondition error
in the latter case. The attribute value MUST be either "required" or
"optional". For conformance with [RFC4918] and Section 5.2.2 of
[I-D.reschke-webdav-search], when this attribute is not specified its
value defaults to "required" when the element occurs as a descendant
of DAV:where, and "optional" anywhere else.
Any element allows the following attributes (where "..." represents
the element type name):
When an unexpected or unknown element is present in the request, the
server MUST:
- Ignore it (and its descendants), if the value of the "extension"
attribute for that element is "optional" (or the "extension"
attribute is missing and the element is not a descendant of DAV:
where). The request is then processed as if the element were not
there.
- Fail with status code 422 (Unprocessable Entity) and
precondition code XS:unexpected-content, if the value of the
"extension" attribute for that element is "required" (or if there is
no "extension" attribute and the element is a descendant of DAV:
where). In this case, the attrname attribute of XS:unexpected-
content MUST NOT be specified. If the element has an "id" attribute,
the idref attribute of the XS:unexpected-content precondition MUST be
the element id, otherwise the "idref" attribute MUST NOT be
specified.
Godoy & Minni Expires July 16, 2008 [Page 30]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
When an unexpected or unknown attribute occurs within an expected
element, the server MUST proceed as if the element itself were
unexpected or unknown. In addition, if the element is required (as
explained above), the attrname attribute of the XS:unexpected-content
precondition MUST be assigned with the name of the offending
attribute.
If present, the idref attribute MUST match the value of some ID
attribute in the request.
7. Security Considerations
The security considerations of WebDAV SEARCH
[I-D.reschke-webdav-search], and WebDAV [RFC4918], as well as those
of HTTP/1.1 [RFC2616] and XML [RFC3023] are applicable to the WebDAV
extension described in this document.
8. IANA Considerations
This document defines XML elements in a XML namespace described by a
URN conforming the registry mechanism described in [RFC3688]. The
following URI assignment is requested
URI: urn:ietf:params:xml:ns:webdav-xml-search
Registrant Contact: See the "Author's Address" section of this
document.
XML: None. Namespace URIs do not represent an XML specification.
Reference: The last version of this document.
9. References
9.1. Normative References
[I-D.reschke-webdav-search] Reschke, J., "Web Distributed
Authoring and Versioning (WebDAV)
SEARCH",
draft-reschke-webdav-search-14 (work
in progress), November 2007.
[RFC2119] Bradner, S., "Key words for use in
Godoy & Minni Expires July 16, 2008 [Page 31]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
RFCs to Indicate Requirement Levels",
BCP 14, RFC 2119, March 1997.
[RFC2616] Fielding, R., Gettys, J., Mogul, J.,
Frystyk, H., Masinter, L., Leach, P.,
and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1",
RFC 2616, June 1999.
[RFC3023] Murata, M., St. Laurent, S., and D.
Kohn, "XML Media Types", RFC 3023,
January 2001.
[RFC3253] Clemm, G., Amsden, J., Ellison, T.,
Kaler, C., and J. Whitehead,
"Versioning Extensions to WebDAV (Web
Distributed Authoring and Versioning
)", RFC 3253, March 2002.
[RFC3688] Mealling, M., "The IETF XML
Registry", BCP 81, RFC 3688,
January 2004.
[RFC3744] Clemm, G., Reschke, J., Sedlar, E.,
and J. Whitehead, "Web Distributed
Authoring and Versioning (WebDAV)
Access Control Protocol", RFC 3744,
May 2004.
[RFC4790] Newman, C., Duerst, M., and A.
Gulbrandsen, "Internet Application
Protocol Collation Registry",
RFC 4790, March 2007.
[RFC4918] Dusseault, L., "HTTP Extensions for
Web Distributed Authoring and
Versioning (WebDAV)", RFC 4918,
June 2007.
[W3C.PR-xpath20-20061121] Berglund, A., Boag, S., Chamberlin,
D., Fernandez, M., Kay, M., Robie,
J., and J. Simeon, "XML Path Language
(XPath) 2.0", World Wide Web
Consortium PR PR-xpath20-20061121,
November 2006, .
[W3C.REC-xml-names11-20060816] Hollander, D., Layman, A., Tobin, R.,
Godoy & Minni Expires July 16, 2008 [Page 32]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
and T. Bray, "Namespaces in XML 1.1
(Second Edition)", World Wide Web
Consortium Recommendation REC-xml-
names11-20060816, August 2006, .
[W3C.REC-xml11-20060816] Maler, E., Sperberg-McQueen, C.,
Cowan, J., Paoli, J., Bray, T., and
F. Yergeau, "Extensible Markup
Language (XML) 1.1 (Second Edition)",
World Wide Web Consortium
Recommendation REC-xml11-20060816,
August 2006, .
[W3C.REC-xmlschema-2-20041028] Malhotra, A. and P. Biron, "XML
Schema Part 2: Datatypes Second
Edition", World Wide Web Consortium R
ecommendation REC-xmlschema-2-
20041028, October 2004, .
9.2. Informative References
[RFC4234] Crocker, D., Ed. and P. Overell,
"Augmented BNF for Syntax
Specifications: ABNF", RFC 4234,
October 2005.
Editorial Comments
[error-DEP] Besides, handling dynamic errors on a
separate basis imposes an additional
requirement, then supporting this
feature is left to the criteria of
implementors.
[note-comparison-complex-type] This seems to be a MUST in
[draft-reschke-webdav-search-14]
Section 5.5.4, but is relaxed here
since the property would be treated
as xs:string if the type were
ignored.
[note-context-position] When supporting numeric predicates
and context position references there
Godoy & Minni Expires July 16, 2008 [Page 33]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
is a trade-off between expressive
power and implementation costs.
[note-intent] The authors' motivation for writing
this specification is allowing
metadata to be searchable when
presented as a WebDAV property.
Since it may be encoded as specified
by a third-party schema, it should
not be modified in order to conform
WebDAV.
[note-namespace] Since this protocol is experimental,
the authors do not suggest new
elements in order to not pollute the
"DAV:" namespace. Thus, an
experimental implementation of this
protocol will not conflict with the
following requirement from RFC 4918:
"(...) an XML element in the "DAV:"
namespace SHOULD NOT be used in the
request or response body unless that
XML element is explicitly defined in
an IETF RFC reviewed by a WebDAV
working group."
[note-opdesc] The operator description is only
intended for discovering whether the
server implements an extension
operator. The DAV:operators element
from [I-D.reschke-webdav-search] is
not adopted here, because it cannot
describe the mandatory operators. On
the other hand, while XML Schemas
would have sufficed for this purpose,
this approach would have required XS:
xml-search clients to be in
conformance to the XML Representation
of Schemas, which is much more than
necessary for achieving the above
mentioned goal (given that the
operators are not too complex). The
chosen approach is compared to ABNF,
in order to avoid further relation
with features that are available in
XML schemas.
[note-OPTIONAL-404] The 404 status code for missing
Godoy & Minni Expires July 16, 2008 [Page 34]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
properties is OPTIONAL in order to
avoid an extensive response if the
client selects several properties
that are seldom defined. Note this
behaviour is different from the
PROPFIND case, where the 404 status
code is REQUIRED for missing
properties (Section 9.1 of [RFC
4918], page 35).
[note-RFC4918-sect17] RFC4918: "(...) servers MUST process
received XML documents as if
unexpected elements and attributes
(and all children of unrecognized
elements) were not there"
[note-select-prop-filter] If the property value is not well-
formed XML specifying both DAV:prop
and XS:filter is ambiguous because a
409 (Conflict) status code must be
returned per XS:filter and the
complete property value must be
returned per DAV:prop. On the other
hand, if the property value were
well-formed XML, one of those
elements would have to be ignored.
Appendix A. Example XS:xml-search query
This example shows a request/response exchange for selecting the DAV:
getcontentlength property and the and first
elements of the property, from resources which are
directly contained in the http://host.example.com/ collection, such
that the title (as described by a M:title element within the
M:metadata property) starts with letter "S". The first results will
have at least one M:author element present.
The response describes two resources:
- foo.pdf, with DAV:getcontentlength = 65536, author = "John Doe"
and title = "Sample Title"
- bar.txt, with DAV:getcontentlength = 1024, title = "Sample
Anonymous Resource" and no author.
Request:
SEARCH / HTTP/1.1
Host: host.example.com
Content-Type: application/xml
Godoy & Minni Expires July 16, 2008 [Page 35]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
Content-Length: xxx
http://host.example.com/1starts-with(/M:title,'S')/M:author
Response:
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx
http://host.example.com/foo.pdf
Godoy & Minni Expires July 16, 2008 [Page 36]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
65536John DoeSample titleHTTP/1.1 200 OKhttp://host.example.com/bar.txt1024Sample Anonymous ResourceHTTP/1.1 200 OK
Index
A
Attribute
attrname (XS:unexpected-content element) 31
extension 30
id 30
idref (XS:unexpected-content element) 31
D
Dynamic Context 5
Dynamic Error 5
Dynamic Evaluation Phase (DEP) 5
E
Element
DAV:and 15
DAV:multistatus 10
DAV:not 15
DAV:or 15
DAV:order 15
DAV:propdesc 24
DAV:response 10
DAV:search-scope-valid 23
DAV:select 15
Godoy & Minni Expires July 16, 2008 [Page 37]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
DAV:where 15
XS:acceptable-role 22
XS:alternative 25
XS:filter 15
XS:is-well-formed 15
XS:known-literal-type 23
XS:opdesc-rule 25
XS:operand-nested-op 25
XS:operand-XPath 25
XS:operator 25
XS:property-must-be-well-formed-xml 22
XS:repetition 25
XS:searchable 24
XS:selectable 24
XS:sortable 24
XS:unexpected-content 31
XS:warning 10
XS:xml-search 15
XS:xml-search-schema 24
XS:XPath 15
XS:XPath-error 23
XS:xpath-error 11
Example
Bad Request, DAV:select 17
DASL Response Header 13
DAV:supported-query-grammar-set 13
Description of DAV:like Operator 29
Extended operator description for DAV:typed-literal operand 29
Implied operator description 28
QSD request 14
QSD response 14
XS:opdesc-rule 26-27
XS:XPath-error (in DEP) 12
XS:XPath-error (in SAP) 11
I
Implementation-defined 5
Implementation-dependent 5
R
Role 5
S
Static Analysis Phase (SAP) 5
Static Context 5
Static Error 6
T
Godoy & Minni Expires July 16, 2008 [Page 38]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
Type Error 6
Authors' Addresses
Roberto Javier Godoy
Universidad Nacional del Litoral,
Facultad de Ingenieria y Ciencias Hidricas,
Departamento de Informatica
Ciudad Universitaria, Ruta Nac. 168
S3001XAI, Paraje "El Pozo"
Argentina
EMail: rjgodoy@fich.unl.edu.ar
Hugo Minni
Universidad Nacional del Litoral,
Facultad de Ingenieria y Ciencias Hidricas,
Departamento de Informatica
Ciudad Universitaria, Ruta Nac. 168
S3001XAI, Paraje "El Pozo"
Argentina
EMail: hminni@fich.unl.edu.ar
Godoy & Minni Expires July 16, 2008 [Page 39]
Internet-Draft WebDAV Search Grammar for XML Properties January 2008
Full Copyright Statement
Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors
retain all their rights.
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST
AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT
THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at
ietf-ipr@ietf.org.
Acknowledgment
Funding for the RFC Editor function is currently provided by the
IETF Administrative Support Activity (IASA).
Godoy & Minni Expires July 16, 2008 [Page 40]