< draft-wilde-home-xml-00.txt   draft-wilde-home-xml-01.txt >
Network Working Group E. Wilde Network Working Group E. Wilde
Internet-Draft EMC Internet-Draft EMC
Intended status: Informational April 1, 2013 Intended status: Informational June 11, 2013
Expires: October 3, 2013 Expires: December 13, 2013
Home Documents for HTTP Services: XML Syntax Home Documents for HTTP Services: XML Syntax
draft-wilde-home-xml-00 draft-wilde-home-xml-01
Abstract Abstract
The current draft for HTTP Home Documents provides a JSON syntax The current draft for HTTP Home Documents provides a JSON syntax
only. This draft provides an XML syntax for the same underlying data only. This draft provides an XML syntax for the same underlying data
model, so that the concept of HTTP Home Documents can be consistently model, so that the concept of HTTP Home Documents can be consistently
exposed in both JSON- and XML-based HTTP services. exposed in both JSON- and XML-based HTTP services.
Note to Readers Note to Readers
Please discuss this draft on the apps-discuss mailing list [5]. Please discuss this draft on the apps-discuss mailing list [7].
Online access to all versions and files is available on github [6]. Online access to all versions and files is available on github [8].
Status of this Memo Status of this Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on October 3, 2013. This Internet-Draft will expire on December 13, 2013.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. XML Example . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. XML Example . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 6 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
4.1. Media Type application/home+xml . . . . . . . . . . . . . . 6 4.1. Media Type application/home+xml . . . . . . . . . . . . . 6
5. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5. Security Considerations . . . . . . . . . . . . . . . . . . . 7
6. Normative References . . . . . . . . . . . . . . . . . . . . . 8 6. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 8 7. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.1. From -00 to -01 . . . . . . . . . . . . . . . . . . . . . 8
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8
8.1. Normative References . . . . . . . . . . . . . . . . . . . 8
8.2. Informative References . . . . . . . . . . . . . . . . . . 9
Appendix A. XML-to-HTML for Home Documents . . . . . . . . . . . 9
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 11
1. Introduction 1. Introduction
An Internet Draft currently under development [1] proposes the An Internet Draft currently under development [1] proposes the
concept of "Home Documents for HTTP APIs" and described them as concept of "Home Documents for HTTP APIs" and described them as
follows: follows:
"This document proposes a 'home document' format for non-browser HTTP "This document proposes a 'home document' format for non-browser HTTP
clients. [...] The goal of home documents is to serve as a starting clients. [...] The goal of home documents is to serve as a starting
point for hypermedia APIs, where clients need to have an entry point, point for hypermedia APIs, where clients need to have an entry point,
skipping to change at page 3, line 33 skipping to change at page 3, line 33
At this point it is undecided whether both drafts will be merged At this point it is undecided whether both drafts will be merged
eventually, or whether they will both be published as separate eventually, or whether they will both be published as separate
documents. Regardless of the final publication setup, it should be documents. Regardless of the final publication setup, it should be
noted that this draft is only defining the XML syntax, whereas all noted that this draft is only defining the XML syntax, whereas all
the concepts represented in this syntax are defined by [1]. the concepts represented in this syntax are defined by [1].
2. XML Example 2. XML Example
The following Home Document in XML syntax uses the same data as the The following Home Document in XML syntax uses the same data as the
Home Document shown in Section 3 of [1]: Home Document shown in Section 2 of [1]:
<resources xmlns="urn:ietf:rfc:XXXX"> <resources xmlns="urn:ietf:rfc:XXXX">
<resource rel="http://example.org/rel/widgets"> <resource rel="http://example.org/rel/widgets">
<link href="/widgets/"/> <link href="/widgets/"/>
</resource> </resource>
<resource rel="http://example.org/rel/widget"> <resource rel="http://example.org/rel/widget">
<template href-template="/widgets/{widget_id}"> <template href-template="/widgets/{widget_id}">
<var name="widget_id" URI="http://example.org/param/widget"/> <var name="widget_id" URI="http://example.org/param/widget"/>
</template> </template>
<hints> <hints>
skipping to change at page 7, line 42 skipping to change at page 7, line 42
<erik.wilde@emc.com> <erik.wilde@emc.com>
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: none Restrictions on usage: none
Author: Erik Wilde <erik.wilde@emc.com> Author: Erik Wilde <erik.wilde@emc.com>
Change controller: IETF Change controller: IETF
5. Open Issues 5. Security Considerations
The general security considerations for XML home documents are the
same as those for JSON home documents, as described in the "Security
Considerations" of [1]. The specific security considerations
introduced by XML as a representation format are described in the
"Security Considerations" of Section 4.1.
6. Open Issues
o The move from a predefined list of hints to a hint registry is not
yet reflected in the XML; in particular because the latest draft
defines the hint data model to be JSON-specific.
o What is the extension model for the XML syntax? Should processing o What is the extension model for the XML syntax? Should processing
of other namespaces be defined as "should ignore", so that same- of other namespaces be defined as "should ignore", so that same-
namespace extensions are encouraged? namespace extensions are encouraged?
o Should the XML syntax provide support for embedded human-readable o Should the XML syntax provide support for embedded human-readable
documentation? This would probably not be supported in the JSON documentation? This would probably not be supported in the JSON
syntax, but could be marked as strictly optional and XML-specific. syntax, but could be marked as strictly optional and XML-specific.
6. Normative References 7. Change Log
Note to RFC Editor: Please remove this section before publication.
7.1. From -00 to -01
o Updated references from draft-nottingham-json-home-02 to
draft-nottingham-json-home-03
o Added "Security Considerations" section.
o Added XSLT for transforming an XML Home Document to a simple HTML
representation.
8. References
8.1. Normative References
[1] Nottingham, M., "Home Documents for HTTP APIs", [1] Nottingham, M., "Home Documents for HTTP APIs",
draft-nottingham-json-home-02 (work in progress), draft-nottingham-json-home-03 (work in progress), May 2013.
September 2012.
[2] Freed, N., Klensin, J., and T. Hansen, "Media Type [2] Freed, N., Klensin, J., and T. Hansen, "Media Type
Specifications and Registration Procedures", BCP 13, RFC 6838, Specifications and Registration Procedures", BCP 13, RFC 6838,
January 2013. January 2013.
[3] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types", [3] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types",
RFC 3023, January 2001. RFC 3023, January 2001.
[4] Sperberg-McQueen, C., Yergeau, F., Paoli, J., Maler, E., and T. [4] Sperberg-McQueen, C., Yergeau, F., Paoli, J., Maler, E., and T.
Bray, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", Bray, "Extensible Markup Language (XML) 1.0 (Fifth Edition)",
World Wide Web Consortium Recommendation REC-xml-20081126, World Wide Web Consortium Recommendation REC-xml-20081126,
November 2008, <http://www.w3.org/TR/2008/REC-xml-20081126>. November 2008, <http://www.w3.org/TR/2008/REC-xml-20081126>.
[5] <https://www.ietf.org/mailman/listinfo/apps-discuss> 8.2. Informative References
[6] <https://github.com/dret/I-D/tree/master/template-desc> [5] Clark, J., "XSL Transformations (XSLT) Version 1.0", World Wide
Web Consortium Recommendation REC-xslt-19991116, November 1999,
<http://www.w3.org/TR/1999/REC-xslt-19991116>.
[6] Pieters, S., Clark, J., and H. Thompson, "Associating Style
Sheets with XML documents 1.0 (Second Edition)", World Wide Web
Consortium Recommendation REC-xml-stylesheet-20101028,
October 2010,
<http://www.w3.org/TR/2010/REC-xml-stylesheet-20101028>.
URIs
[7] <https://www.ietf.org/mailman/listinfo/apps-discuss>
[8] <https://github.com/dret/I-D/tree/master/template-desc>
Appendix A. XML-to-HTML for Home Documents
The following XSLT 1.0 stylesheet [5] transforms XML Home Documents
to very simple HTML renditions. By associating this stylesheet [6]
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.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:home="urn:ietf:rfc:XXXX" exclude-result-prefixes="home">
<xsl:output method="html"/>
<xsl:template match="home:resources">
<html>
<head>
<title>Home Document</title>
</head>
<body>
<h1>Home Document</h1>
<ul>
<xsl:for-each select="home:resource">
<li>
<span title="Link Relation"><xsl:value-of select="@rel"/></span>
<xsl:text>: </xsl:text>
<xsl:choose>
<xsl:when test="home:link">
<a href="{home:link/@href}" title="URI"><xsl:value-of select="home:link/@href"/></a>
</xsl:when>
<xsl:otherwise>
<a href="{home:template/@href-template}" title="URI template"><xsl:value-of select="home:template/@href-template"/></a>
</xsl:otherwise>
</xsl:choose>
<dl>
<xsl:if test="home:template/home:var">
<dt>Variables: </dt>
<dd>
<ul>
<xsl:for-each select="home:template/home:var">
<xsl:sort select="@name"/>
<li>
<span title="Variable Name"><xsl:value-of select="@name"/></span>
<xsl:text>: </xsl:text>
<span title="Associated URI"><xsl:value-of select="@URI"/></span>
</li>
</xsl:for-each>
</ul>
</dd>
</xsl:if>
<xsl:if test="home:hints">
<dt>Hints: </dt>
<dd>
<ul>
<xsl:for-each select="home:hints/home:*">
<xsl:sort select="local-name()"/>
<li>
<span title="Hint Name"><xsl:value-of select="local-name()"/></span>
<xsl:text>: </xsl:text>
<xsl:choose>
<xsl:when test="home:i">
<xsl:for-each select="home:i">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</dd>
</xsl:if>
</dl>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Author's Address Author's Address
Erik Wilde Erik Wilde
EMC EMC
6801 Koll Center Parkway 6801 Koll Center Parkway
Pleasanton, CA 94566 Pleasanton, CA 94566
U.S.A. U.S.A.
Phone: +1-925-6006244 Phone: +1-925-6006244
 End of changes. 13 change blocks. 
19 lines changed or deleted 151 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/