<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>

<rfc xmlns:x='http://purl.org/net/xml2rfc/ext' ipr="full2026" docName="draft-reschke-webdav-property-datatypes-00" xmlns:ed="http://greenbytes.de/2002/rfcedit">
  <x:link rel="Start" href="http://greenbytes.de/tech/webdav/#draft-reschke-webdav-property-datatypes"/>
  <x:link rel="Bookmark" title="IETF WEBDAV Working Group" href="http://ftp.ics.uci.edu/pub/ietf/webdav/"/>
  <x:link rel="next" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-01.html"/>
  <x:link rel="last" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-latest.html"/>
  <x:link rel="Alternate" title="(latest)" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-latest.html"/>
  <x:link rel="Alternate" title="draft 09" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-09.html"/>
  <x:link rel="Alternate" title="draft 08" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-08.html"/>
  <x:link rel="Alternate" title="draft 07" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-07.html"/>
  <x:link rel="Alternate" title="draft 06" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-06.html"/>
  <x:link rel="Alternate" title="draft 05" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-05.html"/>
  <x:link rel="Alternate" title="draft 04" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-04.html"/>
  <x:link rel="Alternate" title="draft 03" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-03.html"/>
  <x:link rel="Alternate" title="draft 02" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-02.html"/>
  <x:link rel="Alternate" title="draft 01" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-01.html"/>
  <x:link rel="Alternate" title="draft 00" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-property-datatypes-00.html"/>
	<front>
    	<title>Datatypes for WebDAV properties</title>
			<author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
			<organization abbrev="greenbytes">greenbytes GmbH</organization>
			<address>
            	<postal>
            		<street>Salzmannstrasse 152</street>
                	<city>Muenster</city><region>NW</region><code>48159</code>
                  <country>Germany</country>
           		</postal>
				<email>julian.reschke@greenbytes.de</email>	
			</address>
		</author>
    <date month="August" year="2001" />
<!--		<workgroup>WEBDAV Working Group</workgroup> -->
        <abstract><t>
This specification extends the WebDAV Distributed Authoring Protocol to 
support datatyping on property values. Protocol elements are 
defined to let clients and servers specify the type of a property, and to
instruct the WebDAV method PROPFIND to return datatype information.
        </t>
		<t>
Distribution of this document is unlimited. Please send comments to the 
Distributed Authoring and Versioning (WebDAV) working group at <eref target="mailto:w3c-dist-auth@w3.org">w3c-dist-auth@w3.org</eref>, which may be joined by sending a message with subject 
"subscribe" to <eref target="mailto:w3c-dist-auth-request@w3.org?subject=subscribe">w3c-dist-auth-request@w3.org</eref>.
		</t><t>
Discussions of the WEBDAV working group are archived at URL: 
<eref target="http://lists.w3.org/Archives/Public/w3c-dist-auth/">http://lists.w3.org/Archives/Public/w3c-dist-auth/</eref>.               
       	</t> 
</abstract>
	</front>

	<middle>


<section title="Notational Conventions">
<t>
	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 <xref target="RFC2119" />.
</t>
<t>
	The term "property element" refers to the XML element that identifies
  a particular property, for instance
</t>
<figure>
<artwork><![CDATA[
	<getcontentlength xmlns="DAV:" />
]]></artwork>
</figure>
<t>
	The term "prop element" is used for the WebDAV "prop" element as defined
  in section 12.11 of <xref target="RFC2518" />.
</t>
<t>
	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: Structures" (<xref target="XS1" />) also defines several
  attributes for direct use in any XML documents. These attributes are in a
  different namespace, which has the namespace name "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.
</t>
</section>

<section title="Introduction">
<t>
  This specification builds on the infrastructure provided by 
  the WebDAV Distributed Authoring Protocol, adding support data-typed
  properties. 
</t>
<t>
	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.
</t>
<t>
	On the other hand, when setting new properties, it can be desirable to
  pass data type 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 data types when doing comparisons and sorting.
</t>
</section>

<section title="Overview of data types">
<t>
  Although WebDAV property types can be anything that can be marshalled
  as content of an XML element, in many cases they actually are simple
  types like integers, booleans or dates. "XML Schema Part 2: Datatypes"
  <xref target="XS2" /> defines a set of simple types which can be
  used as a basis for supplying type information to attributes.  
</t>
<t>
	Data type information is represented using the attribute "type" from the
  XML Schema namespace "http://www.w3.org/2001/XMLSchema-instance".
	In XML Schema, data types are qualified names, and the XML Schema 
  recommendation defines a set of built-in datatypes (section 3 of
  <xref target="XS2" />), defined in the
  namespace "http://www.w3.org/2001/XMLSchema".
</t>
<t>
	To avoid unnecessary verbosity, data type 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 <xref target="RFC2518" /> and for properties of type
  "xs:string".
</t>
<t>
	A server may implement any combination of datatypes, both from the XML
  Schema recommendation and possibly from other namespaces.
</t>
<t>
	Note that a particular property can be typed for a number of reasons:
  <list style="symbols">
  	<t>The property is a live property with server-defined semantics and
    value space.</t>
    <t>The property may have been set using a non-WebDAV protocol that the
    server understands in addition to WebDAV.</t>
    <t>The type may have been specified in an extended PROPPATCH method
    as defined in <xref target="METHOD_PROPPATCH" />.</t>
  </list>  
</t>
</section>

<section title="Changes for PROPPATCH method" anchor="METHOD_PROPPATCH">
<t>
	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 <xref target="XS2" />).
  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.
</t>
<t>
	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 &lt;multistatus&gt; response body).
</t>

<section title="Example for successful PROPPATCH">
<figure><preamble>
   >>Request</preamble>
<artwork><![CDATA[
   PROPPATCH /bar.html HTTP/1.1
   Host: www.foo.com
   Content-Type: text/xml
   Content-Length: xxxx

   <D:propertyupdate xmlns:D="DAV:"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:set>
       <D:prop>
         <Z:released xsi:type="xs:boolean">false</Z:released>
       </D:prop>
     </D:set>
   </D:propertyupdate>
]]></artwork></figure>
<figure><preamble>
   >>Response</preamble>
<artwork><![CDATA[
   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml
   Content-Length: xxxx

   <D:multistatus xmlns:D="DAV:"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:response>
       <D:href>http://www.foo.com/bar.html</D:href>
       <D:propstat>
         <D:prop><Z:released xsi:type="xs:boolean" /></D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
     </D:response>
   </D:multistatus>
]]></artwork></figure>
<t>
	In this cases, the xsi:type attribute on the element "Z:released" indicates
  that the server indeed has understood the submitted data type information.
</t>
</section>


<section title="Example for failed PROPPATCH">
<figure><preamble>
   >>Request</preamble>
<artwork><![CDATA[
   PROPPATCH /bar.html HTTP/1.1
   Host: www.foo.com
   Content-Type: text/xml
   Content-Length: xxxx

   <D:propertyupdate xmlns:D="DAV:"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:set>
       <D:prop>
         <Z:released xsi:type="xs:boolean">t</Z:released>
       </D:prop>
     </D:set>
   </D:propertyupdate>
]]></artwork></figure>
<figure><preamble>
   >>Response</preamble>
<artwork><![CDATA[
   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml
   Content-Length: xxxx

   <D:multistatus xmlns:D="DAV:"
      xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:response>
       <D:href>http://www.foo.com/bar.html</D:href>
       <D:propstat>
         <D:prop><Z:released/></D:prop>
         <D:status>HTTP/1.1 422 Unprocessable Entity</D:status>
         <D:responsedescription>Does not parse as xs:boolean</D:responsedescription>
       </D:propstat>
     </D:response>
   </D:multistatus>
]]></artwork></figure>
<t>
  In this case the request failed because the supplied value "t" is not 
  a valid representation for a boolean value.
</t>
<t>
	Note that similar error conditions can occur in the standard WebDAV protocol
  even though no data type was specified: for instance, when a client tries to set
  a live property for which only a certain value space is allowed.
</t>
</section>

<section title="Example for succesful PROPPATCH where type information was not preserved">
<figure><preamble>
   >>Request</preamble>
<artwork><![CDATA[
   PROPPATCH /bar.html HTTP/1.1
   Host: www.foo.com
   Content-Type: text/xml
   Content-Length: xxxx

   <D:propertyupdate xmlns:D="DAV:"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:set>
       <D:prop>
         <Z:released xsi:type="Z:custom">t</Z:released>
       </D:prop>
     </D:set>
   </D:propertyupdate>
]]></artwork></figure>
<figure><preamble>
   >>Response</preamble>
<artwork><![CDATA[
   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml
   Content-Length: xxxx

   <D:multistatus xmlns:D="DAV:"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:response>
       <D:href>http://www.foo.com/bar.html</D:href>
       <D:propstat>
         <D:prop><Z:released/></D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
     </D:response>
   </D:multistatus>
]]></artwork></figure>
<t>
  In this case the request succeeded, but the server did not know how to
  handle the data type "Z:custom". Therefore no data type information was
  returned in the response body.
</t>
</section>

</section>

<section title="Changes for PROPFIND method">
<t>
  PROPFIND is extended to return the data type information for properties
  unless one of the following conditions is met:
  <list style="symbols">
  	<t>The data type MUST be different from "xs:string" (because this can
    be considered the default data type).</t>
    <t>The property's data type MUST not be defined in <xref target="RFC2518" />
    (because these types are already well-defined).</t>
  </list>
</t>

<section title="Example for PROPFIND/prop">
<figure><preamble>
   >>Request</preamble>
<artwork><![CDATA[
   PROPFIND /bar.html HTTP/1.1
   Host: www.foo.com
   Content-Type: text/xml
   Content-Length: xxxx

   <D:propfind xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50">
     <D:prop>
       <D:getcontenttype/>
       <Z:released/>
     </D:prop>
   </D:propfind>
]]></artwork></figure>
<figure><preamble>
   >>Response</preamble>
<artwork><![CDATA[
   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml
   Content-Length: xxxx

   <D:multistatus xmlns:D="DAV:" xmlns:Z="http://www.w3.com/standards/z39.50"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <D:response>
       <D:href>http://www.foo.com/bar.html</D:href>
       <D:propstat>
         <D:prop>
           <D:getcontenttype>text/html</D:getcontenttype> 
           <Z:released xsi:type="xs:boolean">1</Z:released>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
   </D:multistatus>
]]></artwork></figure>
<t>
	This example shows that the property value "true" is returned with the
  correct data type information, and that the server chose one of the two
  possible representations defined in XML Schema. It also shows that
  data type information is not returned for "D:getcontenttype", as this
  property's data type is already defined in <xref target="RFC2518" />.
</t>
</section>

</section>

<section title="Compatibility Considerations">
<t>
	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 data type information
  in an attribute on the property element (previously undefined), and 
  adds an additional attribute on property elements upon PROPFIND.
</t>
<t>
	Clients not aware of this specification 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). 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).
</t>
<t>
	Servers not aware of this specification either drop the "xsi:type"
  attribute, or persist it along with the property value. However, they
  will never indicate successful parsing of the data type by returning
  back the type in the response to PROPPATCH.
</t>

</section>

<section title="Internationalization Considerations">
<t>
   This proposal builds on <xref target="RFC2518" />, and inherits its 
   internationalizability.
</t>
</section>

<section title="IANA Considerations">
<t>
   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.
</t>
</section>

<section title="Copyright">
<t>
To be supplied by the RFC Editor.
</t>
</section>

<section title="Intellectual Property">
<t>
To be supplied by the RFC Editor.
</t>
</section>

    </middle>
	<back>

<references>
	

<reference anchor='RFC2119'>

<front>
<title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Scott Bradner'>
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>-</email></address></author>
<date month='March' year='1997'></date>
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   In many standards track documents several words are used to signify
   the requirements in the specification.  These words are often
   capitalized.  This document defines these words as they should be
   interpreted in IETF documents.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<t>
      The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
      NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,  &quot;MAY&quot;, and
      &quot;OPTIONAL&quot; in this document are to be interpreted as described in
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name='BCP' value='14' />
<seriesInfo name='RFC' value='2119' />
</reference>

<reference anchor="XML" target="http://www.w3.org/TR/1998/REC-xml-19980210">
<front>
<title>Extensible Markup Language (XML) 1.0</title>
<author initials='T.' surname='Bray' fullname='Tim Bray'>
<organization>Textuality and Netscape</organization>
<address><email>tbray@textuality.com</email></address></author>
<author initials='J.' surname='Paoli' fullname='Jean Paoli'>
<organization>Microsoft</organization>
<address><email>jeanpa@microsoft.com</email></address></author>
<author initials='C. M.' surname='Sperberg-McQueen' fullname='C. M. Sperberg-McQueen'>
<organization>University of Illinois at Chicago and Text Encoding Initiative</organization>
<address><email>cmsmcq@uic.edu</email></address></author>
<author initials='E.' surname='Maler' fullname='Eve Maler'>
<organization>Sun Microsystems</organization>
<address><email>eve.maler@east.sun.com</email></address></author>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3c.org</uri>
</address>
</author>
<date month="February" year="1998" />
</front>
<seriesInfo name="W3C" value="XML" />
</reference>

<reference anchor="XS1" target="http://www.w3.org/TR/xmlschema-1/">
<front>
<title>XML Schema Part 1: Structures</title>
<author initials='H. S.' surname='Thompson' fullname='Henry S. Thompson'>
<organization>University of Edinburgh</organization>
<address><email>ht@cogsci.ed.ac.uk</email></address></author>
<author initials='D.' surname='Beech' fullname='David Beech'>
<organization>Oracle</organization>
<address><email>David.Beech@oracle.com</email></address></author>
<author initials='M.' surname='Maloney' fullname='Murray Maloney'>
<organization>(for) Commerce One</organization>
<address><email>murray@muzmo.com</email></address></author>
<author initials='N.' surname='Mendelsohn' fullname='Noah Mendelsohn'>
<organization>Lotus Development Corporation</organization>
<address><email>Noah_Mendelsohn@lotus.com</email></address></author>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3c.org</uri>
</address>
</author>
<date month="May" year="2001" />
</front>
<seriesInfo name="W3C" value="XS1" />
</reference>

<reference anchor="XS2" target="http://www.w3.org/TR/xmlschema-2/">
<front>
<title>XML Schema Part 2: Datatypes</title>
<author initials='P. V.' surname='Biron' fullname='Paul V. Biron'>
<organization>Kaiser Permanente, for Health Level Seven</organization>
<address><email>Paul.V.Biron@kp.org</email></address></author>
<author initials='A.' surname='Malhotra' fullname='Ashok Malhotra'>
<organization>Microsoft, formerly of IBM</organization>
<address><email>ashokma@microsoft.com</email></address></author>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3c.org</uri>
</address>
</author>
<date month="May" year="2001" />
</front>
<seriesInfo name="W3C" value="XS2" />
</reference>

<reference anchor='RFC2518'>

<front>
<title>HTTP Extensions for Distributed Authoring -- WEBDAV</title>
<author initials='Y.' surname='Goland' fullname='Y. Goland'>
<organization></organization></author>
<author initials='E.' surname='Whitehead' fullname='E. Whitehead'>
<organization></organization></author>
<author initials='A.' surname='Faizi' fullname='A. Faizi'>
<organization></organization></author>
<author initials='S.' surname='Carter' fullname='S. Carter'>
<organization></organization></author>
<author initials='D.' surname='Jensen' fullname='D. Jensen'>
<organization></organization></author>
<date month='February' year='1999'></date></front>

<seriesInfo name='RFC' value='2518' />
</reference>
</references>

    </back>
</rfc>
