Abstract
The
Atom Syndication Format 0.3 pre-draft states that "Any element in an Atom document MAY have an xml:base attribute. However, XML Base [W3C.REC-xmlbase-20010627] processing MUST NOT be applied to element or attribute content, unless that element or attribute's specification explicitly includes XML Base processing."
The purpose of this proposal is to reverse that statement so that xml:base processing applies to all constructs which are specified to be URIs, and also to included external content, for example in <content> elements.
Status
Accepted
Rationale
xml:base is designed to provide a general-purpose solution for locally establishing the base URI for the purpose of resolving relative URI references. There are many situations where the use of relative URI references is good practice, and there is no reason to forbid their use anywhere Atom specifies a URI, and there is no reason not to use xml:base appropriately.
Furthermore, it is often the case that items from feeds wish to encode links within the item (e.g. from one paragraph to another) or the feed (e.g. from one item to another). The use of relative URIs is good practice in these situations, and appropriate processing of xml:base allows such relative references to copied directly from the upstream data source into <item> elements as appropriate.
Proposal
Remove the following from
3.2.2 and
3.4.3:
-
xml:base [W3C.REC-xmlbase-20010627] processing MUST be applied to the atom:url element.
Replace the following paragraph in
section 2
-
Any element in an Atom document MAY have an xml:base attribute. However, XML Base [
with the following text
-
Relative URI references, and their use in combination with a base URI, are explained in
Any element in an Atom document MAY have an xml:base attribute. The presence of such an attribute establishes a Base URI within Document Content as specified in
RFC2396bis 5.1.1. Consequently, XML Base [REC-xmlbase-20010627] processing MUST be applied to any relative URI reference which appears where Atom specifies a URI and within the scope of an xml:base attribute.
When text is included within an Atom feed, for example in <atom:summary> and <atom:content> elements, and when such text is being processed by software that may recognize and use URI references, and when there is an xml:base attribute in scope in the containing Atom markup, then for that text, the URI from the xml:base is considered to be the Base URI from the Encapsulating Entity as specified in
RFC2396bis 5.1.2.
For example, in the following feed:
<feed version="0.3" xmlns="http://purl.org/atom/ns#"
xml:base="http://example.com/feed1/">
<title>dive into mark</title>
<link rel="alternate" type="text/html" href="main" />
<modified>2003-12-13T18:30:02Z</modified>
<author>
<name>Mark Pilgrim</name>
</author>
<entry xml:base="http://example.com/feed1/2003/12/13/">
<title>Atom 0.3 snapshot</title>
<link rel="alternate" type="text/html"
href="atom03"/>
<id>tag:diveintomark.org,2003:3.2397</id>
<issued>2003-12-13T08:29:29-04:00</issued>
<modified>2003-12-13T18:30:02Z</modified>
<content type="application/xhtml+xml">Check out <a href="rant">this</a>!</content>
</entry>
</feed>
-
Then the URI for the feed <link> element is "http://example.com/feed1/main", for the entry <link> element is "http://example.com/feed1/2003/12/13/atom03", and for the <a> element in <content> is "http://example.com/feed1/2003/12/13/rant"
Impacts
None
