<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc toc="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc symrefs="no" ?>
<rfc ipr="trust200902" docName="draft-wilde-home-xml-00" category="info">
	<front>
	  <title abbrev="Home Documents XML">Home Documents for HTTP Services: XML Syntax</title>
	   <author initials="E." surname="Wilde" fullname="Erik Wilde">
	      <organization>EMC</organization>
	      <address>
            <postal>
               <street>6801 Koll Center Parkway</street>
               <city>Pleasanton, CA 94566</city>
               <country>U.S.A.</country>
            </postal>
            <phone>+1-925-6006244</phone>
            <email>erik.wilde@emc.com</email>
            <uri>http://dret.net/netdret/</uri>
         </address>
     </author>
     <date day="1" month="April" year="2013"/>
  	<abstract>
      <t>The current draft for HTTP Home Documents provides a JSON syntax only. This draft provides an XML syntax for the same underlying data model, so that the concept of HTTP Home Documents can be consistently exposed in both JSON- and XML-based HTTP services.</t>
    </abstract>
    <note title="Note to Readers">
        <t>Please discuss this draft on the <eref target="https://www.ietf.org/mailman/listinfo/apps-discuss">apps-discuss mailing list</eref>.</t>
        <t>Online access to all versions and files is available on <eref target="https://github.com/dret/I-D/tree/master/template-desc">github</eref>.</t>
     </note>
  </front>
  <middle>
    <section title="Introduction">
      <t>An Internet Draft currently under development <xref target="I-D.nottingham-json-home"/> proposes the concept of "Home Documents for HTTP APIs" and described them as follows:</t>
      <t>"This document proposes a 'home document' format for non-browser HTTP clients. [...] The goal of home documents is to serve as a starting point for hypermedia APIs, where clients need to have an entry point, and then can use the API by following links. Home documents thus serve the same purpose as home pages on web sites: They are stable entry points that provide starting points for clients with some knowledge of the services linked from them."</t>
      <t>While this general concept of a home document is independent of the representation format, the current draft only defines a JSON syntax. In order to make this concept available across representations, this draft defines an XML syntax for the concepts defined in <xref target="I-D.nottingham-json-home"/>.</t>
      <t>At this point it is undecided whether both drafts will be merged eventually, or whether they will both be published as separate documents. Regardless of the final publication setup, it should be noted that this draft is only defining the XML syntax, whereas all the concepts represented in this syntax are defined by <xref target="I-D.nottingham-json-home"/>.</t>
    </section>
    <section title="XML Example" anchor="xml-example">
      <t>The following Home Document in XML syntax uses the same data as the Home Document shown in <eref target="http://tools.ietf.org/html/draft-nottingham-json-home-02#section-3">Section 3</eref> of <xref target="I-D.nottingham-json-home"/>:</t>
      <figure>
        <artwork type="xml"><![CDATA[<resources xmlns="urn:ietf:rfc:XXXX">
 <resource rel="http://example.org/rel/widgets">
  <link href="/widgets/"/>
 </resource>
 <resource rel="http://example.org/rel/widget">
  <template href-template="/widgets/{widget_id}">
   <var name="widget_id" URI="http://example.org/param/widget"/>
  </template>
  <hints>
   <allow>
    <i>GET</i>
    <i>PUT</i>
    <i>DELETE</i>
    <i>PATCH</i>
   </allow>
   <representations>
    <i>application/json</i>
   </representations>
   <accept-patch>
    <i>application/patch+json</i>
   </accept-patch>
   <accept-post>
    <i>application/xml</i>
   </accept-post>
   <accept-ranges>
    <i>bytes</i>
   </accept-ranges>
  </hints>
 </resource>
</resources>]]></artwork>
      </figure>
      <t>The mapping between JSON arrays and XML uses "item" elements &lt;i/>, where each of those elements represents one array item. For properties that have a single values (i.e., they are not defined as an array of values), this value is directly contained as content in the corresponding element.</t>
      <t>Currently, the draft does not specify an extension model (how to represents hints that are not specified in the draft itself), and therefore the extension model for XML is currently undefined as well. The XML syntax will be updated to reflect the extension model once it has been specified for the JSON syntax.</t>
    </section>
    <section title="XML Schema" anchor="xml-schema">
      <t>The following XML Schema is describing the XML shown in <xref target="xml-example"/>. Since there currently is no extension model, the XML Schema does currently not contain any extension points.</t>
      <figure>
        <artwork type="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ietf:rfc:XXXX"
 elementFormDefault="qualified" xmlns:home="urn:ietf:rfc:XXXX">
 <xs:element name="resources">
  <xs:complexType>
   <xs:sequence maxOccurs="unbounded" minOccurs="0">
    <xs:element name="resource">
     <xs:complexType>
      <xs:sequence>
       <xs:choice>
        <xs:element name="link">
         <xs:complexType>
          <xs:attribute name="href" type="xs:anyURI" use="required"/>
         </xs:complexType>
        </xs:element>
        <xs:element name="template">
         <xs:complexType>
          <xs:sequence maxOccurs="unbounded" minOccurs="0">
           <xs:element name="var">
            <xs:complexType>
             <xs:attribute name="name" use="required"/>
             <xs:attribute name="URI" type="xs:anyURI" use="required"/>
            </xs:complexType>
           </xs:element>
          </xs:sequence>
          <xs:attribute name="href-template" use="required"/>
         </xs:complexType>
        </xs:element>
       </xs:choice>
       <xs:element minOccurs="0" name="hints">
        <xs:complexType>
         <xs:choice maxOccurs="unbounded" minOccurs="0">
          <xs:element name="allow" type="home:arrayType"/>
          <xs:element name="representations" type="home:arrayType"/>
          <xs:element name="accept-patch" type="home:arrayType"/>
          <xs:element name="accept-post" type="home:arrayType"/>
          <xs:element name="accept-put" type="home:arrayType"/>
          <xs:element name="accept-ranges" type="home:arrayType"/>
          <xs:element name="prefer" type="home:arrayType"/>
          <xs:element name="docs" type="xs:anyURI"/>
          <xs:element name="precondition-req" type="home:arrayType"/>
          <xs:element name="auth-req">
           <xs:complexType>
            <xs:sequence maxOccurs="unbounded" minOccurs="0">
             <xs:element name="scheme">
              <xs:complexType>
               <xs:sequence maxOccurs="unbounded" minOccurs="0">
                <xs:element name="realm"/>
               </xs:sequence>
               <xs:attribute name="name" type="xs:token"/>
              </xs:complexType>
             </xs:element>
            </xs:sequence>
           </xs:complexType>
          </xs:element>
          <xs:element name="status">
           <xs:simpleType>
            <xs:restriction base="xs:token">
             <xs:enumeration value="deprecated"/>
             <xs:enumeration value="gone"/>
            </xs:restriction>
           </xs:simpleType>
          </xs:element>
         </xs:choice>
        </xs:complexType>
       </xs:element>
      </xs:sequence>
      <xs:attribute name="rel" type="xs:anyURI" use="required"/>
     </xs:complexType>
    </xs:element>
   </xs:sequence>
  </xs:complexType>
 </xs:element>
 <xs:complexType name="arrayType">
  <xs:sequence maxOccurs="unbounded" minOccurs="0">
   <xs:element name="i"/>
  </xs:sequence>
 </xs:complexType>
</xs:schema>]]></artwork>
      </figure>
    </section>
    <section title="IANA Considerations" anchor="iana">
      <t>This specification registers a media type for the XML syntax of Home Documents (as defined in <xref target="I-D.nottingham-json-home"/>).</t>
      <section title="Media Type application/home+xml" anchor="media-type">
        <t>The Internet media type <xref target="RFC6838"/> for a Home Document in XML syntax is application/home+xml.</t>
        <t>Type name: application</t>
        <t>Subtype name: home+xml</t>
        <t>Required parameters: none</t>
        <t>Optional parameters: Same as charset parameter for the media type "application/xml" as specified in RFC 3023 <xref target="RFC3023"/>.</t>
        <t>Encoding considerations: Same as encoding considerations of media type "application/xml" as specified in RFC 3023 <xref target="RFC3023"/>.</t>
        <t>Security considerations: This media type has all of the security considerations described in RFC 3023 <xref target="RFC3023"/> and <xref target="I-D.nottingham-json-home"/>.</t>
        <t>Interoperability considerations: N/A</t>
        <t>Published specification: RFC XXXX</t>
        <t>Applications that use this media type: Applications that publish Home Documents for HTTP services using XML syntax.</t>
        <t>Additional information:
          <list>
            <t>Magic number(s): N/A</t>
            <t>File extension(s): XML documents should use ".xml" as the file extension.</t>
            <t>Macintosh file type code(s): TEXT</t>
          </list>
        </t>
        <t>Person &amp; email address to contact for further information: Erik Wilde &lt;erik.wilde@emc.com></t>
        <t>Intended usage: COMMON</t>
        <t>Restrictions on usage: none</t>
        <t>Author: Erik Wilde &lt;erik.wilde@emc.com></t>
        <t>Change controller: IETF</t>
      </section>
    </section>
    <section title="Open Issues" anchor="open-issues">
      <t><list style="symbols">
        <t>What is the extension model for the XML syntax? Should processing of other namespaces be defined as "should ignore", so that same-namespace extensions are encouraged?</t>
        <t>Should the XML syntax provide support for embedded human-readable documentation? This would probably not be supported in the JSON syntax, but could be marked as strictly optional and XML-specific.</t>
      </list></t>
    </section>
    <!-- 
    <section title="Change Log">
      <t>Note to RFC Editor: Please remove this section before publication.</t>
      <section title="From -00 to -01">
        <t>
          <list style="symbols">
            <t>...</t>
          </list>
        </t>
      </section>
    </section>
-->
  </middle>
  <back>
    <references title="Normative References">
      <reference anchor='I-D.nottingham-json-home'>
        <front>
          <title>Home Documents for HTTP APIs</title>
          <author initials='M' surname='Nottingham' fullname='Mark Nottingham'>
            <organization />
          </author>
          <date month='September' day='13' year='2012' />
          <abstract>
            <t>This document proposes a "home document" format for non-browser HTTP clients.  Note to Readers  This draft should be discussed on the apps-discuss mailing list [1].</t>
          </abstract>
        </front>
        <seriesInfo name='Internet-Draft' value='draft-nottingham-json-home-02' />
        <format type='TXT' target='http://www.ietf.org/internet-drafts/draft-nottingham-json-home-02.txt' />
      </reference>
      <reference anchor='RFC3023'>
        <front>
          <title>XML Media Types</title>
          <author initials='M.' surname='Murata' fullname='M. Murata'>
            <organization /></author>
          <author initials='S.' surname='St. Laurent' fullname='S. St. Laurent'>
            <organization /></author>
          <author initials='D.' surname='Kohn' fullname='D. Kohn'>
            <organization /></author>
          <date year='2001' month='January' />
          <abstract>
            <t>This document standardizes five new media types - text/xml, application/xml, text/xml-external-parsed-entity, application/xml- external-parsed-entity, and application/xml-dtd - for use in exchanging network entities that are related to the Extensible Markup Language (XML). This document also standardizes a convention (using the suffix '+xml') for naming media types outside of these five types when those media types represent XML MIME (Multipurpose Internet Mail Extensions) entities. [STANDARDS-TRACK]</t></abstract>
        </front>
        <seriesInfo name='RFC' value='3023' />
        <format type='TXT' octets='86011' target='http://www.rfc-editor.org/rfc/rfc3023.txt' />
      </reference>
      <reference anchor='RFC6838'>
        <front>
          <title>Media Type Specifications and Registration Procedures</title>
          <author initials='N.' surname='Freed' fullname='N. Freed'>
            <organization />
          </author>
          <author initials='J.' surname='Klensin' fullname='J. Klensin'>
            <organization />
          </author>
          <author initials='T.' surname='Hansen' fullname='T. Hansen'>
            <organization />
          </author>
          <date year='2013' month='January' />
          <abstract>
            <t>This document defines procedures for the specification and registration of media types for use in HTTP, MIME, and other Internet protocols.  This memo documents an Internet Best Current Practice.</t>
          </abstract>
        </front>
        <seriesInfo name='BCP' value='13' />
        <seriesInfo name='RFC' value='6838' />
        <format type='TXT' octets='72942' target='http://www.rfc-editor.org/rfc/rfc6838.txt' />
      </reference>
      <reference anchor='W3C.REC-xml-20081126' target='http://www.w3.org/TR/2008/REC-xml-20081126'>
        <front>
          <title>Extensible Markup Language (XML) 1.0 (Fifth Edition)</title>
          <author initials='C.' surname='Sperberg-McQueen' fullname='C. M. Sperberg-McQueen'>
            <organization />
          </author>
          <author initials='F.' surname='Yergeau' fullname='Francois Yergeau'>
            <organization />
          </author>
          <author initials='J.' surname='Paoli' fullname='Jean Paoli'>
            <organization />
          </author>
          <author initials='E.' surname='Maler' fullname='Eve Maler'>
            <organization />
          </author>
          <author initials='T.' surname='Bray' fullname='Tim Bray'>
            <organization />
          </author>
          <date month='November' day='26' year='2008' />
        </front>
        <seriesInfo name='World Wide Web Consortium Recommendation' value='REC-xml-20081126' />
        <format type='HTML' target='http://www.w3.org/TR/2008/REC-xml-20081126' />
      </reference>
    </references>
  </back>
</rfc>
