<?xml version="1.0" encoding="UTF-8"?><rfc ipr="trust200902" docName="draft-wilde-home-xml-04" category="info" obsoletes="" updates="" submissionType="IETF" xml:lang="en">
	<front>
	  <title abbrev="Home Documents XML">Home Documents for HTTP APIs: XML Syntax</title>
	  <author initials="E." surname="Wilde" fullname="Erik Wilde">
	    <organization/>
	    <address>
            <email>erik.wilde@dret.net</email>
            <uri>http://dret.net/netdret/</uri>
         </address>
	  </author>
	  <date day="27" month="June" year="2016"/>
  	<abstract>
      <t>The specification for HTTP API Home Documents provides a JSON syntax only. This specification provides an XML syntax for the same data model, so that the concept of Home Documents can be consistently exposed in both JSON- and XML-based HTTP APIs. It also defines the link relation type "home" so that applications can identify links to home documents.</t>
    </abstract>
    <note title="Note to Readers">
      <t>Please discuss this draft on the apps-discuss mailing list (<eref target="https://www.ietf.org/mailman/listinfo/apps-discuss"/>).</t>
      <t>Online access to all versions and files is available on GitHub (<eref target="https://github.com/dret/I-D/tree/master/home-xml"/>).</t>
     </note>
  </front>
  <middle>
    <section title="Introduction" toc="default">
      <t>"Home Documents for HTTP APIs" <xref target="I-D.nottingham-json-home" pageno="false" format="default"/> proposes the concept of "Home Documents" and describes 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 specification only defines a JSON syntax. In order to make this concept available across representations, this specification defines an XML syntax for the concepts defined in <xref target="I-D.nottingham-json-home" pageno="false" format="default"/>.</t>
      <t>One notable difference is the handling of links found in "href" or "href-template" attributes of "resource" elements: In the JSON syntax, these are (if they are relative URIs) resolved against the URI of the home document itself. The XML syntax adds support for an optional "xml:base" attribute <xref target="W3C.REC-xmlbase-20090128" pageno="false" format="default"/> on the "resources" document element. If this attribute is present, it has to be used according to its specification, and thus becomes part of a possible resolution chain of relative URIs.</t>
    </section>
    <section title="XML Example" anchor="xml-example" toc="default">
      <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-04#section-2">Section 2</eref> of <xref target="I-D.nottingham-json-home" pageno="false" format="default"/> (but adding xml:base="http://example.com" to demonstrate the mechanism):</t>
      <figure title="" align="left" alt="" width="" height="">
        <artwork type="xml" xml:space="preserve" name="" align="left" alt="" width="" height="">&lt;?xml-stylesheet type="text/xsl" href="home-xml-02.xslt"?&gt;
&lt;resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="urn:ietf:params:xml:ns:homedoc home-xml.xsd"
 xmlns="urn:ietf:params:xml:ns:homedoc" xml:base="tag:me@example.com,2016:"&gt;
 &lt;resource rel="http://example.org/rel/widgets"&gt;
  &lt;link href="/widgets"/&gt;
 &lt;/resource&gt;
 &lt;resource rel="widgets"&gt;
  &lt;template href-template="/widgets/{widget_id}"&gt;
   &lt;var name="widget_id" URI="widget"/&gt;
  &lt;/template&gt;
  &lt;hints&gt;
   &lt;allow&gt;
    &lt;i&gt;GET&lt;/i&gt;
    &lt;i&gt;PUT&lt;/i&gt;
    &lt;i&gt;DELETE&lt;/i&gt;
    &lt;i&gt;PATCH&lt;/i&gt;
   &lt;/allow&gt;
   &lt;formats&gt;
    &lt;format mediatype="application/json"/&gt;
   &lt;/formats&gt;
   &lt;accept-patch&gt;
    &lt;i&gt;application/json-patch+json&lt;/i&gt;
   &lt;/accept-patch&gt;
   &lt;accept-post&gt;
    &lt;i&gt;application/xml&lt;/i&gt;
   &lt;/accept-post&gt;
   &lt;accept-ranges&gt;
    &lt;i&gt;bytes&lt;/i&gt;
   &lt;/accept-ranges&gt;
  &lt;/hints&gt;
 &lt;/resource&gt;
&lt;/resources&gt;</artwork>
      </figure>
      <t>The mapping between JSON arrays and XML uses "item" elements &lt;i/&gt;, 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" toc="default">
      <t>The following XML Schema is describing the XML shown in <xref target="xml-example" pageno="false" format="default"/>. Since there currently is no extension model, the XML Schema does currently not contain any extension points.</t>
      <figure title="" align="left" alt="" width="" height="">
        <artwork type="xml" xml:space="preserve" name="" align="left" alt="" width="" height="">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xml="http://www.w3.org/XML/1998/namespace" targetNamespace="urn:ietf:params:xml:ns:homedoc" elementFormDefault="qualified" xmlns:home="urn:ietf:params:xml:ns:homedoc"&gt;
 &lt;xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/&gt;
 &lt;xs:element name="resources"&gt;
  &lt;xs:complexType&gt;
   &lt;xs:sequence maxOccurs="unbounded" minOccurs="0"&gt;
    &lt;xs:element name="resource"&gt;
     &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
       &lt;xs:choice&gt;
        &lt;xs:element name="link"&gt;
         &lt;xs:complexType&gt;
          &lt;xs:attribute name="href" type="xs:anyURI" use="required"/&gt;
         &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
        &lt;xs:element name="template"&gt;
         &lt;xs:complexType&gt;
          &lt;xs:sequence maxOccurs="unbounded" minOccurs="0"&gt;
           &lt;xs:element name="var"&gt;
            &lt;xs:complexType&gt;
             &lt;xs:attribute name="name" use="required"/&gt;
             &lt;xs:attribute name="URI" type="xs:anyURI" use="required"/&gt;
            &lt;/xs:complexType&gt;
           &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
          &lt;xs:attribute name="href-template" use="required"/&gt;
         &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
       &lt;/xs:choice&gt;
       &lt;xs:element minOccurs="0" name="hints"&gt;
        &lt;xs:complexType&gt;
         &lt;xs:choice maxOccurs="unbounded" minOccurs="0"&gt;
          &lt;xs:element name="allow" type="home:arrayType"/&gt;
          &lt;xs:element name="formats"&gt;
           &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
             &lt;xs:element name="format"&gt;
              &lt;xs:complexType&gt;
               &lt;xs:attribute name="mediatype" type="home:mediaTypeType"/&gt;
              &lt;/xs:complexType&gt;
             &lt;/xs:element&gt;
            &lt;/xs:sequence&gt;
           &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
          &lt;xs:element name="accept-patch" type="home:mediaTypeArrayType"/&gt;
          &lt;xs:element name="accept-post" type="home:mediaTypeArrayType"/&gt;
          &lt;xs:element name="accept-ranges" type="home:arrayType"/&gt;
          &lt;xs:element name="accept-prefer" type="home:arrayType"/&gt;
          &lt;xs:element name="docs" type="xs:anyURI"/&gt;
          &lt;xs:element name="precondition-req" type="home:arrayType"/&gt;
          &lt;xs:element name="auth-req"&gt;
           &lt;xs:complexType&gt;
            &lt;xs:sequence maxOccurs="unbounded" minOccurs="0"&gt;
             &lt;xs:element name="scheme"&gt;
              &lt;xs:complexType&gt;
               &lt;xs:sequence maxOccurs="unbounded" minOccurs="0"&gt;
                &lt;xs:element name="realm"/&gt;
               &lt;/xs:sequence&gt;
               &lt;xs:attribute name="name" type="xs:token"/&gt;
              &lt;/xs:complexType&gt;
             &lt;/xs:element&gt;
            &lt;/xs:sequence&gt;
           &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
          &lt;xs:element name="status"&gt;
           &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:token"&gt;
             &lt;xs:enumeration value="deprecated"/&gt;
             &lt;xs:enumeration value="gone"/&gt;
            &lt;/xs:restriction&gt;
           &lt;/xs:simpleType&gt;
          &lt;/xs:element&gt;
         &lt;/xs:choice&gt;
        &lt;/xs:complexType&gt;
       &lt;/xs:element&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="rel" type="xs:anyURI" use="required"/&gt;
     &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
   &lt;/xs:sequence&gt;
   &lt;xs:attribute ref="xml:base" use="optional"/&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;
 &lt;xs:simpleType name="mediaTypeType"&gt;
  &lt;xs:restriction base="xs:string"/&gt;
 &lt;/xs:simpleType&gt;
 &lt;xs:complexType name="arrayType"&gt;
  &lt;xs:sequence maxOccurs="unbounded" minOccurs="0"&gt;
   &lt;xs:element name="i"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
 &lt;xs:complexType name="mediaTypeArrayType"&gt;
  &lt;xs:sequence maxOccurs="unbounded" minOccurs="0"&gt;
   &lt;xs:element name="i" type="home:mediaTypeType"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:schema&gt;
</artwork>
      </figure>
    </section>
    <section title="IANA Considerations" anchor="iana" toc="default">
      <t>This specification registers a media type and an XML namespace URI for the XML syntax of Home Documents (as defined in <xref target="I-D.nottingham-json-home" pageno="false" format="default"/>).</t>
      <section title="Media Type application/home+xml" anchor="iana-media-type" toc="default">
        <t>The Internet media type <xref target="RFC6838" pageno="false" format="default"/> 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" pageno="false" format="default"/>.</t>
        <t>Encoding considerations: Same as encoding considerations of media type "application/xml" as specified in RFC 3023 <xref target="RFC3023" pageno="false" format="default"/>.</t>
        <t>Security considerations: This media type has all of the security considerations described in RFC 3023 <xref target="RFC3023" pageno="false" format="default"/> and <xref target="I-D.nottingham-json-home" pageno="false" format="default"/>.</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&gt;</t>
        <t>Intended usage: COMMON</t>
        <t>Restrictions on usage: none</t>
        <t>Author: Erik Wilde &lt;erik.wilde@emc.com&gt;</t>
        <t>Change controller: IETF</t>
      </section>
      <section title="XML Namespace Registration" anchor="iana-xml-namespace" toc="default">
        <t>This document registers the following XML namespaces in the IETF XML registry defined in <xref target="RFC3688" pageno="false" format="default"/>.</t>
        <t>URI: urn:ietf:params:xml:ns:homedoc</t>
        <t>Registrant: The IESG.</t>
        <t>XML: N/A, the requested URI is an XML namespace defined by an RFC.</t>
      </section>
      <section title="Link Relation Type" anchor="iana-link-rel" toc="default">
        <t>The link relation type below has been registered by IANA per Section 6.2.1 of RFC 5988 <xref target="RFC5988" pageno="false" format="default"/>:</t>
        <section title="Link Relation Type: home" toc="default">
          <t>
            <list>
              <t>Relation Name: home</t>
              <t>Description: Identifies a resource that provides a "home" document for the context resource. Home documents often serve as starting points for a certain resource context, such as for Web APIs where the home resource provides access to a number of "entry points" to the Web API.</t>
              <t>Reference: RFC XXXX</t>
            </list>
          </t>
        </section>
      </section>
    </section>
    <section title="Implementation Status" anchor="implementation-status" toc="default">
      <t>Note to RFC Editor: Please remove this section before publication.</t>
      <t>This section records the status of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in RFC 6982 <xref target="RFC6982" pageno="false" format="default"/>. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors. This is not intended as, and must not be construed to be, a catalog of available implementations or their features. Readers are advised to note that other implementations may exist.</t>
      <t>According to RFC 6982, "this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature. It is up to the individual working groups to use this information as they see fit".</t>
      <t>For a list of implementations, please refer to the wiki that tracks implementations for the Home Document specification in general:</t>
      <t>
        <list>
          <t><eref target="https://github.com/mnot/I-D/wiki/json-home"/></t>
        </list>
      </t>
    </section>
    <section title="Security Considerations" anchor="security-considerations" toc="default">
      <t>The general security considerations for XML home documents are the same as those for JSON home documents, as described in the "Security Considerations" of <xref target="I-D.nottingham-json-home" pageno="false" format="default"/>. The specific security considerations introduced by XML as a representation format are described in the "Security Considerations" of <xref target="RFC3023" pageno="false" format="default"/>.</t>
    </section>
    <section title="Open Issues" anchor="open-issues" toc="default">
      <t><list style="symbols">
        <t>The move from a predefined list of hints to a hint registry is not yet reflected in the XML; in particular because the draft defines the hint data model to be JSON-specific.</t>
        <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>
  </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="May" day="23" year="2016"/>
          <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-04"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-nottingham-json-home-04.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="RFC3688" target="http://www.rfc-editor.org/info/rfc3688">
        <front>
          <title>The IETF XML Registry</title>
          <author initials="M." surname="Mealling" fullname="M. Mealling"><organization/></author>
          <date year="2004" month="January"/>
          <abstract><t>This document describes an IANA maintained registry for IETF standards which use Extensible Markup Language (XML) related items such as Namespaces, Document Type Declarations (DTDs), Schemas, and Resource Description Framework (RDF) Schemas.</t></abstract>
        </front>
        <seriesInfo name="BCP" value="81"/>
        <seriesInfo name="RFC" value="3688"/>
        <seriesInfo name="DOI" value="10.17487/RFC3688"/>
      </reference>
      <reference anchor="RFC5988">
        <front>
          <title>Web Linking</title>
          <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
            <organization/>
          </author>
          <date month="October" year="2010"/>
        </front>
        <seriesInfo name="RFC" value="5988"/>
      </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>
      <reference anchor="W3C.REC-xmlbase-20090128" target="http://www.w3.org/TR/2009/REC-xmlbase-20090128">
        <front>
          <title>XML Base (Second Edition)</title>
          <author initials="J." surname="Marsh" fullname="Jonathan Marsh">
            <organization/>
          </author>
          <author initials="R." surname="Tobin" fullname="Richard Tobin">
            <organization/>
          </author>
          <date month="January" day="28" year="2009"/>
        </front>
        <seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xmlbase-20090128"/>
        <format type="HTML" target="http://www.w3.org/TR/2009/REC-xmlbase-20090128"/>
      </reference>
    </references>
    <references title="Informative References">
      <reference anchor="W3C.REC-xslt-19991116" target="http://www.w3.org/TR/1999/REC-xslt-19991116">
        <front>
          <title>XSL Transformations (XSLT) Version 1.0</title>
          <author initials="J." surname="Clark" fullname="James Clark">
            <organization/>
          </author>
          <date month="November" day="16" year="1999"/>
        </front>
        <seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xslt-19991116"/>
        <format type="HTML" target="http://www.w3.org/TR/1999/REC-xslt-19991116"/>
      </reference>
      <reference anchor="W3C.REC-xml-stylesheet-20101028" target="http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028">
        <front>
          <title>Associating Style Sheets with XML documents 1.0 (Second Edition)</title>
          <author initials="S." surname="Pieters" fullname="Simon Pieters">
            <organization/>
          </author>
          <author initials="J." surname="Clark" fullname="James Clark">
            <organization/>
          </author>
          <author initials="H." surname="Thompson" fullname="Henry S. Thompson">
            <organization/>
          </author>
          <date month="October" day="28" year="2010"/>
        </front>
        <seriesInfo name="World Wide Web Consortium Recommendation" value="REC-xml-stylesheet-20101028"/>
        <format type="HTML" target="http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028"/>
      </reference>
      <reference anchor="RFC6982">
        <front>
          <title>Improving Awareness of Running Code: The Implementation Status Section</title>
          <author initials="Y." surname="Sheffer" fullname="Y. Sheffer">
            <organization/></author>
          <author initials="A." surname="Farrel" fullname="A. Farrel">
            <organization/></author>
          <date year="2013" month="July"/>
          <abstract>
            <t>This document describes a simple process that allows authors of Internet-Drafts to record the status of known implementations by including an Implementation Status section. This will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature.&lt;/t&gt;&lt;t&gt; The process in this document is offered as an experiment. Authors of Internet-Drafts are encouraged to consider using the process for their documents, and working groups are invited to think about applying the process to all of their protocol specifications. The authors of this document intend to collate experiences with this experiment and to report them to the community.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="6982"/>
        <format type="TXT" octets="19358" target="http://www.rfc-editor.org/rfc/rfc6982.txt"/>
      </reference>
    </references>
    <section title="XML-to-HTML for Home Documents" toc="default">
      <t>The following XSLT 1.0 stylesheet <xref target="W3C.REC-xslt-19991116" pageno="false" format="default"/> transforms XML Home Documents to very simple HTML renditions. By associating this stylesheet <xref target="W3C.REC-xml-stylesheet-20101028" pageno="false" format="default"/> with an XML Home Document, it is possible to serve XML Home Documents that will be rendered in a human-friendly way when viewed in a browser.</t>
      <t><figure title="" align="left" alt="" width="" height="">
        <artwork type="xml" xml:space="preserve" name="" align="left" alt="" width="" height="">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xml="http://www.w3.org/XML/1998/namespace" version="1.0" xmlns:home="urn:ietf:params:xml:ns:homedoc" exclude-result-prefixes="home"&gt;
 &lt;xsl:output method="html"/&gt;
 &lt;xsl:template match="home:resources"&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;title&gt;Home Document&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;h1&gt;Home Document&lt;/h1&gt;
    &lt;ul&gt;
     &lt;xsl:for-each select="home:resource"&gt;
      &lt;li&gt;
       &lt;xsl:text&gt;Link Relation &lt;/xsl:text&gt;
       &lt;code&gt;&lt;xsl:value-of select="@rel"/&gt;&lt;/code&gt;
       &lt;xsl:text&gt;: Link &lt;/xsl:text&gt;
       &lt;code&gt;
        &lt;xsl:choose&gt;
         &lt;xsl:when test="home:link"&gt;
          &lt;xsl:variable name="link-URI"&gt;
           &lt;xsl:call-template name="resolve-URI"&gt;
            &lt;xsl:with-param name="URI" select="home:link/@href"/&gt;
           &lt;/xsl:call-template&gt;
          &lt;/xsl:variable&gt;
          &lt;a href="{$link-URI}" title="URI"&gt;&lt;xsl:value-of select="$link-URI"/&gt;&lt;/a&gt;
         &lt;/xsl:when&gt;
         &lt;xsl:otherwise&gt;
          &lt;xsl:variable name="template-URI"&gt;
           &lt;xsl:call-template name="resolve-URI"&gt;
            &lt;xsl:with-param name="URI" select="home:template/@href-template"/&gt;
           &lt;/xsl:call-template&gt;
          &lt;/xsl:variable&gt;
          &lt;a href="{$template-URI}" title="URI template"&gt;&lt;xsl:value-of select="$template-URI"/&gt;&lt;/a&gt;
         &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;
       &lt;/code&gt;
       &lt;dl&gt;
        &lt;xsl:if test="home:template/home:var"&gt;
         &lt;dt&gt;Variables: &lt;/dt&gt;
         &lt;dd&gt;
          &lt;ul&gt;
           &lt;xsl:for-each select="home:template/home:var"&gt;
            &lt;xsl:sort select="@name"/&gt;
            &lt;li&gt;
             &lt;span title="Variable Name"&gt;&lt;xsl:value-of select="@name"/&gt;&lt;/span&gt;
             &lt;xsl:text&gt;: &lt;/xsl:text&gt;
             &lt;span title="Associated URI"&gt;&lt;xsl:value-of select="@URI"/&gt;&lt;/span&gt;
            &lt;/li&gt;
           &lt;/xsl:for-each&gt;
          &lt;/ul&gt;
         &lt;/dd&gt;
        &lt;/xsl:if&gt;
        &lt;xsl:if test="home:hints"&gt;
         &lt;dt&gt;Hints: &lt;/dt&gt;
         &lt;dd&gt;
          &lt;ul&gt;
           &lt;xsl:for-each select="home:hints/home:*"&gt;
            &lt;xsl:sort select="local-name()"/&gt;
            &lt;li&gt;
             &lt;span title="Hint Name"&gt;&lt;xsl:value-of select="local-name()"/&gt;&lt;/span&gt;
             &lt;xsl:text&gt;: &lt;/xsl:text&gt;
             &lt;xsl:choose&gt;
              &lt;xsl:when test="home:i"&gt;
               &lt;xsl:for-each select="home:i"&gt;
                &lt;xsl:value-of select="."/&gt;
                &lt;xsl:if test="position() != last()"&gt;
                 &lt;xsl:text&gt;, &lt;/xsl:text&gt;
                &lt;/xsl:if&gt;
               &lt;/xsl:for-each&gt;
              &lt;/xsl:when&gt;
              &lt;xsl:otherwise&gt;
               &lt;xsl:value-of select="."/&gt;
              &lt;/xsl:otherwise&gt;
             &lt;/xsl:choose&gt;
            &lt;/li&gt;
           &lt;/xsl:for-each&gt;
          &lt;/ul&gt;
         &lt;/dd&gt;
        &lt;/xsl:if&gt;
       &lt;/dl&gt;
      &lt;/li&gt;
     &lt;/xsl:for-each&gt;
    &lt;/ul&gt;
   &lt;/body&gt;
  &lt;/html&gt;
 &lt;/xsl:template&gt;
 &lt;xsl:template name="resolve-URI"&gt;
  &lt;xsl:param name="URI"/&gt;
  &lt;!-- This is not how URI resolution should be done; http://tools.ietf.org/html/rfc3986#section-5 describes the correct process. --&gt;
  &lt;xsl:value-of select="concat(/home:resources/@xml:base, $URI)"/&gt;
 &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</artwork>
      </figure></t>
    </section>
  </back>
</rfc>