RFC 4316
Datatypes for Web Distributed Authoring and Versioning (WebDAV) Properties
RFC 4316 π Datatypes for WebDAV Properties
okay bestie, RFC 4316 is an Experimental doc by Julian Reschke from greenbytes, dated December 2005 π It's about giving WebDAV properties datatypes so servers and clients can actually know what a value is. Nothing in the header says it obsoletes or updates another RFC, so there's no drama there π«Ά
Status of This Memo π
this memo defines an Experimental Protocol for the Internet community. it's not an Internet standard of any kind, and they're actively asking for discussion and suggestions for improvement. distribution of the memo is unlimited β¨
Copyright Notice Β©οΈ
Copyright (C) The Internet Society (2005).
Abstract π
this spec extends WebDAV so it supports datatyping π¦ it adds protocol elements that let clients and servers specify a property's datatype, and it tells the WebDAV PROPFIND method to send back that datatype info π§
Table of Contents πΈ
1. Introduction ....................................................2
2. Notational Conventions ..........................................2
3. Overview ........................................................3
4. Changes for PROPPATCH Method ....................................4
4.1. Example of Successful PROPPATCH ............................4
4.2. Example of Failed PROPPATCH ................................5
4.3. Example of Successful PROPPATCH Where Type
Information Was Not Preserved ..............................6
5. Changes for PROPFIND Method .....................................7
5.1. Example of PROPFIND/prop ...................................7
6. Changes for Other Methods .......................................8
7. Compatibility Considerations ....................................8
8. Internationalization Considerations .............................9
9. Security Considerations .........................................9
10. Acknowledgements ...............................................9
11. References .....................................................9
11.1. Normative References ......................................9
11.2. Informative References ....................................9
1. Introduction β¨
okay so this spec is built on top of WebDAV and adds support for data-typed properties π
servers have to support XML content in property values, but it can be really useful to store values as plain scalars when possible, and then show the data's type when the value goes back to the client π the client is free to ignore that info, but it might be able to use it when it changes a property π«Ά
when you're setting new properties, it's also helpful to send the datatype along with the value. the server can use that to optimize storage and do extra parsing (dates, for example) π servers that do searching can use known datatypes for comparisons and sorting too, which is so smart π§
these potential datatyping features were deliberately left 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.
2. 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].
the term "property element" means the XML element that names a specific property, like this π:
<getcontentlength xmlns="DAV:" />
the term "prop element" is used for the WebDAV "prop" element, which is defined in Section 12.11 of [RFC2518] π
the XML representation of schema components uses a vocabulary identified by the namespace name "http://www.w3.org/2001/XMLSchema".
to keep things short, the text and examples use the prefix "xs:" for that namespace. in practice, any prefix works π "XML Schema Part 1: Structures" ([XS1]) also defines several attributes that you can use directly in any XML document. those attributes live in a different namespace, "http://www.w3.org/2001/XMLSchema-instance". again for brevity, the text and examples use the prefix "xsi:" for that one, and any prefix is fine in practice β¨
3. Overview π¦
WebDAV property types can be anything that can be marshaled as content of an XML element, but in lots of cases they're actually simple types like integers, booleans, or dates π "XML Schema Part 2: Datatypes" [XS2] defines a set of simple types you can use as a base for giving type info to attributes.
datatype info is represented with the attribute "type" from the XML Schema instance 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 (Section 3 of [XS2]) in the namespace "http://www.w3.org/2001/XMLSchema" π₯
to avoid unnecessary wordiness, datatype info should only be included if it adds something useful to the protocol π specifically, type info isn't required for live properties defined in WebDAV [RFC2518], or 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 πΈ
a particular property can end up typed for a few different 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 Section 4.
4. Changes for PROPPATCH Method π
if the property element has an XML attribute named xsi:type, the server may use that info to pick an optimized representation for storing the value. for example, by specifying a type of "xs:boolean", the client declares the value to be of type boolean (as defined in [XS2]) β¨ the server may pick any suitable internal format for persisting the property, and it's specifically allowed to fail the request if the format given doesn't fit the format defined for that type π
the server should indicate that it successfully detected and parsed the typed value by setting the xsi:type attribute on the property element in the response body. (this implies it should return a MULTISTATUS status code and a <multistatus> response body) π«Ά
4.1. Example of Successful PROPPATCH π
Request
PROPPATCH /bar.html HTTP/1.1
Host: example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<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://ns.example.org/standards/z39.50">
<D:set>
<D:prop>
<Z:released xsi:type="xs:boolean">false</Z:released>
</D:prop>
</D:set>
</D:propertyupdate>
Response
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<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://ns.example.org/standards/z39.50">
<D:response>
<D:href>http://example.org/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>
in this case, the xsi:type attribute on the Z:released element shows that the server really did understand the datatype info that was sent π₯°
4.2. Example of Failed PROPPATCH π
Request
PROPPATCH /bar.html HTTP/1.1
Host: example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<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://ns.example.org/standards/z39.50">
<D:set>
<D:prop>
<Z:released xsi:type="xs:boolean">t</Z:released>
</D:prop>
</D:set>
</D:propertyupdate>
Response
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"
xmlns:Z="http://ns.example.org/standards/z39.50">
<D:response>
<D:href>http://example.org/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>
in this case the request failed, because the value "t" isn't a valid way to write a boolean β
heads up: similar errors can happen in standard WebDAV even when no datatype was specified. for example, when a client tries to set a live property that only allows a certain value space.
4.3. Example of Successful PROPPATCH Where Type Information Was Not Preserved π«
Request
PROPPATCH /bar.html HTTP/1.1
Host: example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:Z="http://ns.example.org/standards/z39.50">
<D:set>
<D:prop>
<Z:released xsi:type="Z:custom">t</Z:released>
</D:prop>
</D:set>
</D:propertyupdate>
Response
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:Z="http://ns.example.org/standards/z39.50">
<D:response>
<D:href>http://example.org/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>
in this one the request succeeded, but the server didn't know how to handle the datatype "Z:custom" π€·ββοΈ so no datatype info came back in the response body.
5. Changes for PROPFIND Method π
PROPFIND gets extended so it returns datatype info for properties, by adding xsi:type attributes to the property elements π the exception is when one of these conditions is true:
- 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 [RFC2518] (because these types are already well-defined).
5.1. Example of PROPFIND/prop
okay so here's a PROPFIND/prop example bestie, and it's giving exactly what we need π β¨
>>Request
PROPFIND /bar.html HTTP/1.1
Host: example.org
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:"
xmlns:Z="http://ns.example.org/standards/z39.50">
<D:prop>
<D:getcontenttype/>
<Z:released/>
</D:prop>
</D:propfind>
>>Response
HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxxx
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"
xmlns:Z="http://ns.example.org/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://example.org/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>
ngl the vibe here is so iconic π¦ The server gives back the property value true with the correct datatype info attached, and it picks one of the two ways XML Schema lets you write a boolean π Meanwhile D:getcontenttype doesn't get any datatype info back, because its datatype is already defined in [RFC2518] so it's not repeating itself π
6. Changes for Other Methods
servers that use the DAV:multistatus response format too (like the REPORT method from [RFC3253], Section 3.6) SHOULD apply the same extensions we just covered in Section 5 π«Ά consistency is everything, periodt π
7. Compatibility Considerations
okay this part is lowkey the best bit for keeping things chill π§ This specification doesn't add any new protocol elements, and it doesn't change the informal WebDAV DTD either β¨ It just spells out extra server behaviour for when clients send datatype info in an attribute on the property element (which was never defined before), and it adds one more attribute on property elements during PROPFIND π
clients that don't know about datatype handling should not supply the "xsi: type" attribute on property elements. like, this attribute lives in the XML Schema-Instance namespace, which was literally made for this exact job, see [XS1], Section 2.6.1 π old clients should also ignore extra attributes on property elements returned by PROPFIND (and similar methods) π the WebDAV spec only says how to handle unknown elements, and it's totally silent on unknown attributes (see [RFC2518], Section 23.3.2.2) so this is a bit of a gray zone bestie π
servers that don't know about datatype handling either drop the "xsi:type" attribute or keep it hanging around along with the property value (see [RFC2518], Section 4.4) π but they'll never say "yep, I parsed that datatype" by sending the type back in the PROPPATCH response. So clients can just send type info without checking in advance whether the server supports it π«Άβ¨
8. Internationalization Considerations
this proposal is built on [RFC2518] and inherits its internationalizability πΈ no extra work needed, which is a whole mood π
9. Security Considerations
π¨ okay this part is serious, bestie, so listen up π This protocol extension does not introduce any new security implications beyond those already documented for the base protocol (see [RFC2518], Section 17). So the security stuff from the base spec still applies, and nothing new is added on top of it. Don't skip reading [RFC2518], Section 17 π₯
10. Acknowledgements
big thank you π«Ά this document got really thoughtful discussion from Lisa Dusseault, Stefan Eissing, Eric Sedlar, and Kevin Wiggen. They're the real MVPs π
11. References
11.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S., and D.
Jensen, "HTTP Extensions for Distributed Authoring --
WEBDAV", RFC 2518, February 1999.
[XS1] Thompson, H., Beech, D., Maloney, M., Mendelsohn, N., and
World Wide Web Consortium, "XML Schema Part 1: Structures
Second Edition", W3C REC-xmlschema-1-20041028,
October 2004,
<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/>.
[XS2] Biron, P., Malhotra, A., and World Wide Web Consortium,
"XML Schema Part 2: Datatypes Second Edition", W3C REC-
xmlschema-2-20041028, October 2004,
<http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.
11.2. Informative References
[RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J.
Whitehead, "Versioning Extensions to WebDAV", RFC 3253,
March 2002.
Author's Address
Julian F. Reschke
greenbytes GmbH
Hafenweg 16
Muenster, NW 48155
Germany
Phone: +49 251 2807760
Fax: +49 251 2807761
EMail: julian.reschke@greenbytes.de
URI: http://greenbytes.de/tech/webdav/
Full Copyright Statement
Copyright (C) The Internet Society (2005). π
this document is subject to the rights, licenses and restrictions in BCP 78 and at www.rfc-editor.org/copyright.html, and unless it says otherwise there, the authors keep all their rights π
β οΈ this document and the info in it are provided on an "AS IS" basis. THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY 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 doesn't take a position on whether any Intellectual Property Rights or other rights that might be claimed about the tech in this document are valid or how far they reach, or whether any license for them is available π¦ it also doesn't claim to have done any independent work to find those rights. Info on the procedures for rights in RFC documents is in BCP 78 and BCP 79 π
copies of IPR disclosures made to the IETF Secretariat, and any assurances of licenses that might be made available, or the result of any attempt to get a general license or permission for implementers or users to use those proprietary rights, can be found in the IETF on-line IPR repository at http://www.ietf.org/ipr π
the IETF invites anyone interested to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology needed to implement this standard. Send that info to the IETF at ietf-ipr@ietf.org π«Ά
Acknowledgement
funding for the RFC Editor function is currently provided by the Internet Society π thank you for reading all of this, bestie π§β¨
π¦ where this page comes from
- ietf: rfc4316 2005-12
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms