Datatypes for WebDAV pWeb Distributed Authoring and Versioning (WebDAV) Propertiesgreenbytes GmbHHafenweg 16MuensterNW48155Germany+49 251 2807760+49 251 2807761julian.reschke@greenbytes.dehttp://greenbytes.de/tech/webdav/
This specification extends the Web Distributed Authoring and Versioning Protocol (WebDAV) to
support datatyping. Protocol elements are defined to let clients and servers
specify the datatype, and to instruct the WebDAV method PROPFIND to return datatype information.
Please send comments to the Distributed Authoring and Versioning (WebDAV)
working group at , which may
be joined by sending a message with subject "subscribe" to
. Discussions of the
WEBDAV working group are archived at
.
Note that although discussion takes place on the WebDAV working
group's mailing list, this is not a working group document.
XML versions, latest edits and the issues list for this document
are available from .
Umbrella issue for editorial fixes/enhancements.
This specification builds on the infrastructure provided by
the WebDAV Distributed Authoring and Versioning (WebDAV) Protocol, adding support for data-typed
properties.
Although servers must support XML content in property values, it may be
desirable to persist values as scalar values when possible, and to expose
the data's type when the property value is returned to the client. The client
is free to ignore this information, but it may be able to take advantage of it
when modifying a property.
On the other hand, when setting new properties, it can be desirable to
pass datatype information along with the value. A server can take advantage
of this information to optimize storage and to perform additional parsing (for
instance, of dates). Servers that support searching can also take advantage
of known datatypes when doing comparisons and sorting.
The following potential datatyping-related features were deliberately
considered out of scope:
getting "schema" information for classes of resources (set of "required"
properties, their types, display information),definition of a set of mandatory property types,discovery of supported property types,extensions to PROPPATCH that would allow updates to parts of a (structured) property.
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 .
The term "property element" refers to the XML element that identifies
a particular property, for instance,
The term "prop element" is used for the WebDAV "prop" element as defined
in sSection 12.11 of .
The XML representation of schema components uses a vocabulary identified by
the namespace name "http://www.w3.org/2001/XMLSchema". For brevity, the text
and examples in this specification use the prefix "xs:"
to stand for this namespace; in practice, any prefix can be used. "XML Schema Part 1:
Structures" () also defines several
attributes for direct use in any XML documents. These attributes are in a
different namespace named "http://www.w3.org/2001/XMLSchema-instance". For
brevity, the text and examples in this specification use the prefix "xsi:"
to stand for this latter namespace; in practice, any prefix can be used.
Although WebDAV property types can be anything that can be marshaled
as content of an XML element, in many cases they actually are simple
types like integers, booleans, or dates. "XML Schema Part 2: Datatypes"
defines a set of simple types whichthat can be
used as a basis for supplying type information to attributes.
Datatype information is represented using the attribute "type" from the
XML Schema namespace "http://www.w3.org/2001/XMLSchema-instance". In
XML Schema, datatypes are qualified names, and the XML Schema
recommendation defines a set of built-in datatypes (sSection 3 of
), defined in the
namespace "http://www.w3.org/2001/XMLSchema".
To avoid unnecessary verbosity, datatype information should only be
supplied if it adds usable information to the protocol. In particular,
type information is not required for live properties defined in
WebDAV and for properties of type
"xs:string".
A server may implement any combination of datatypes, both from the XML
Schema recommendation and possibly from other namespaces.
Note that a particular property can be typed for a number of reasons:
The property is a live property with server-defined semantics and
value space.The property may have been set using a non-WebDAV protocol that the
server understands in addition to WebDAV.The type may have been specified in an extended PROPPATCH method
as defined in .
If the property element has an XML attribute named "xsi:type",
the server may use this information to select an optimized representation
for storing the property value. For instance, by specifying
a type as "xs:boolean", the client declares the property
value to be of type boolean (as defined in ). The
server may choose any suitable internal format for persisting this
property, and in particular is allowed to fail the request if the format
given does not fit the format defined for this type.
The server should indicate successful detection and parsing of the typed value
by setting the xsi:type attribute on the property element in the response
body (this implies that it should return a MULTISTATUS status code and
a <multistatus> response body).
In this cases, the xsi:type attribute on the element "Z:released" indicates
that the server indeed has understood the submitted data type information.
In this case, the request failed because the supplied value "t" is not
a valid representation for a boolean value.
Note that similar error conditions can occur in the standard WebDAV protocol
even though no datatype was specified: for instance, when a client tries to set
a live property for which only a certain value space is allowed.
In this case, the request succeeded, but the server did not know how to
handle the datatype "Z:custom". Therefore, no datatype information was
returned in the response body.
PROPFIND is extended to return the datatype information for properties
by adding "xsi:type" attributes to the property elements
unless one of the following conditions is met:
The datatype MUST be different from "xs:string" (because this can
be considered the default datatype).The property's datatype MUST NOT be defined in
(because these types are already well-defined).
This example shows that the property value "true" is returned with the
correct datatype information, and that the server chose one of the two
possible representations defined in XML Schema. It also shows that
datatype information is not returned for "D:getcontenttype", as this
property's datatype is already defined in .
Servers that support other methods using the DAV:multistatus response format
(such as the REPORT method defined in , sSection 3.6)
SHOULD apply the same extensions as defined in .
This part of this specification does not introduce any new protocol elements, nor does
it change the informal WebDAV DTD. It merely specifies additional server
semantics for the case where clients submit additional datatype information
in an attribute on the property element (previously undefined), and
adds an additional attribute on property elements upon PROPFIND.
Clients not aware of datatype handling should not supply the "xsi:type"
attribute on property elements (after all, this attribute belongs to the
XML Schema-Instance namespace, which has been defined for exactly this
purpose; see
, Section 2.6.1). Old clients should also ignore additional attributes on
property elements returned by PROPFIND (and similar methods), although
the WebDAV specification only defines this behaviour for unknown elements
(and is silent about unknown attributes)and is silent about unknown attributes (see , Section 23.3.2.2).
Servers not aware of datatype handling either drop the "xsi:type"
attribute, or persist it or have it persist along with the property value (see
, Section 4.4). However, they
will never indicate successful parsing of the datatype by returning
back the type in the response to PROPPATCH. Thus,
clients can supply type information without having to poll for server support
in advance.
This proposal builds on , and inherits its
internationalizability.
This protocol extension does not introduce any new security implications
beyond those documented for the base protocol (see , Section 17).
This proposal does not introduce any new IANA considerations, since
it does not specify any new namespaces (in the general sense), but
merely uses existing ones.
This draftdocument has benefited from thoughtful discussion by
Lisa Dusseault,
Stefan Eissing,
Eric Sedlar, and Kevin Wiggen.
Key words for use in RFCs to Indicate Requirement LevelsHarvard Universitysob@harvard.edu
General
keywordXML Schema Part 1: StructuresUniversity of Edinburghht@cogsci.ed.ac.ukOracleDavid.Beech@oracle.com(for) Commerce Onemurray@muzmo.comLotus Development CorporationNoah_Mendelsohn@lotus.comWorld Wide Web ConsortiumMIT Laboratory for Computer Science545 Technology SquareCambridgeMA02139US+ 1 617 253 2613+ 1 617 258 5999timbl@w3.orghttp://www.w3c.orgXML Schema Part 1: Structures Second EditionUniversity of Edinburghht@cogsci.ed.ac.ukOracleDavid.Beech@oracle.com(for) Commerce Onemurray@muzmo.comLotus Development CorporationNoah_Mendelsohn@lotus.comWorld Wide Web ConsortiumMIT Laboratory for Computer Science545 Technology SquareCambridgeMA02139US+ 1 617 253 2613+ 1 617 258 5999timbl@w3.orghttp://www.w3c.orgXML Schema Part 2: Datatypes Second EditionKaiser Permanente, for Health Level SevenPaul.V.Biron@kp.orgMicrosoft, formerly of IBMashokma@microsoft.comWorld Wide Web ConsortiumMIT Laboratory for Computer Science545 Technology SquareCambridgeMA02139US+ 1 617 253 2613+ 1 617 258 5999timbl@w3.orghttp://www.w3c.orgHTTP Extensions for Distributed Authoring -- WEBDAVMicrosoft Corporationyarong@microsoft.comDept. Of Information and Computer Science, University of California, Irvineejw@ics.uci.eduNetscapeasad@netscape.comNovellsrcarter@novell.comNovelldcjensen@novell.comVersioning Extensions to WebDAVRational Softwaregeoffrey.clemm@rational.comIBMjamsden@us.ibm.comIBMtim_ellison@uk.ibm.comMicrosoftckaler@microsoft.comUC Santa Cruz, Dept. of Computer Scienceejw@cse.ucsc.edu
Editorial fixes.
Changed examples to explicitly use utf-8 encoding for HTTP content type and
XML encoding.
Added example for marshalling array-typed properties.
Fix width of artwork for IETF compliance.
"Non-normative references" -> "Informative references".
Added marshalling for property flags such as "hidden" and "protected".
Moved array marshalling example into back section.
Added rational and description for pf:property-displayname-set.
Added acknowledgements section.
Replaced domain names in examples according to RFC2606:
"www.foo.com" by "example.org", "www.example.com" by "ns.example.org/standards/z39.50/standards/z39.50" and
"www.w3.com/standards/z39.50" by "ns.example.org/standards/z39.50".
Remove superfluous IP and copyright sections. Moved "Introduction" section
to front.
Added proposal for DAV:basicsearch operators for array-typed properties.
Update all references.
Reformat abstract. Remove property flags, displayname support and
DASL extensions.
Rewrite Editorial Note. Get rid of unnecessary sub section titles
after removal of property flags and displayname support (no change tracking).
Some typos fixed. Add and resolve issues "other-method-semantics",
"1_clarify_scope", "7_discovery" and "a_remove_array_example".
Removed unused reference to XML spec (no change tracking).
Update XS2 reference. Add "Security Considerations" section.
Update XS1 reference. Add references to "Compatibility Considerations" section.
Author's address updated. Fixed language based on RFC Editor feedback.