UserPreferences

PaceReformedContent3


Abstract

It appears that PaceContentAsTextOrHtml, PaceContentSrc, PaceNukeMultipart, PaceSimpleContentType are all related, and that discussion on the WG up to September 3 suggests consensus is achievable on the related issues.

This third in the series of proposals starting with the original PaceReformedContent provides special "HTML" and "XHTML" values for the @type attribute which have the same effect as "text/html" and "application/xhtml+xml" in previous iterations but don't claim to be media types as they stand.

Also, provided a value "TEXT" to allow explicitly specifying the default; this is good markup design.

Also, introduced the notion of "discrete media types" from RFC2045.

Also, forbade the use of "TEXT", "HTML", and "XHTML" in @type when "src=" is provided, i.e. the content is remote.

Also, reorganized the text to be longer but more readable by replicating the HTML-specific rules for both "HTML" and "XHTML".

Took out the exhortations about well-formedness; this is handled at a higher level in the definition of atom.

Added a note that if you have <content type="application/foo+xml">, you'd expect there to be a single child element which is the root element of the payload.

Tried to be more explicit in the "src=" discussion per Graham's comments.

Fixed the examples (I hope).

The comment from Ulsberg/McLeod calling for media-type parameters has been preserved to avoid losing it; someone needs to write a Pace on this subject.

Status

Open

Rationale

The number and type of values for the @type attribute, the kludginess of the @mode attribute, and the handling of accessibility issues are all strongly related. This proposal gives us a single <atom:content> element, provides a simple set of rules for dispatching on @type values without excessively limiting the repertoire of types, and provides a good accessibility baseline.

Proposal

Replace section 3.1 with a new section:

3.1 Text Constructs

A Text Construct contains human readable text, usually in fairly small quantities.

Text Constructs MAY have a "type" attribute. When present, the value MUST be one of "TEXT", "HTML" or "XHTML". If the "type" attribute is not provided, software MUST behave as though it were present with a value of "TEXT".

If the value is "TEXT", the content of the Text Construct MUST NOT contain child elements. Such text is intended to be presented to humans in a readable fashion. Thus, software MAY display it using normal text rendering techniques such as proportional fonts, white-space collapsing, and justification.

If the value of "type" is "HTML", the content of the Text Construct MUST NOT contain child elements, and SHOULD be suitable for handling by software that knows HTML. The HTML markup must be encoded; for example, "<br>" as "&lt;br>". The HTML markup SHOULD be such that it could validly appear directly within an HTML <DIV> element. Receiving software which displays the content MAY use the markup to aid in displaying it.

If the value of "type" is "XHTML", the content of the Text Construct MAY contain child elements. The content SHOULD be XHTML text and markup that could validly appear directly within an xhtml:div element. Receiving software which displays the content MAY use the markup to aid in displaying it.


Change the definitions of "atom:title", "atom:tagline", "atom:copyright", "atom:info", and "atom:summary" to define them as "Text Constructs" rather than "Content Constructs"


Add the following paragraph to 5.9 "atom:summary" Element

atom:entry elements MUST contain an atom:summary element in any of the following cases:


Replace 5.10 "atom:content" element as follows

5.10 "atom:content" Element

The "atom:content" element either contains or links to the content of the entry. atom:entry elements MUST contain zero or one atom:content elements.

atom:content MAY have a "type" attribute, When present, the value MAY be one of "TEXT", "HTML", or "XHTML". Failing that, it MUST be an Internet Media Type in which, to sue the terminology of Section 5 of [RFC2045], the top level is a discrete type. If the type attribute is not provided, software MUST behave as though it were present with a value of "TEXT".

atom:content MAY have a "src" attribute, whose value MUST be a URI. If the "src" attribute is present, software MAY use the URI to retrieve the content. If the "src" attribute is present, atom:content MUST be empty. That is to say, the content may be retrievable using "src=" URI, or it may be contained within atom:content, but not both.

If the "src" attribute is present, the "type" attribute MUST be provided and MUST be an Internet Media Type, rather than "TEXT", "HTML", or "XHTML". The value is advisory; that is to say, upon dereferencing the URI to retrieve the content, if the server providing that content also provides a media type, the server-provided media type is authoritative. If the "src" attribute is present, the "type" attribute SHOULD be provided.

If the value of type begins with "text/" or ends with "+xml", the content SHOULD be local; that is to say, no "src" attribute should be provided.

Software MUST apply the following rules in succession in the order below to ascertain the rules governing the content of "atom:content".

  1. If the value is "TEXT", the content of atom:content MUST NOT contain child elements. Such text is intended to be presented to humans in a readable fashion. Thus, software MAY display it using normal text rendering techniques such as proportional fonts, white-space collapsing, and justification.

  2. If the value of "type" is "HTML", the content of atom:content MUST NOT contain child elements, and SHOULD be suitable for handling by software that knows HTML. The HTML markup must be encoded; for example, "<br>" as "&lt;br>". The HTML markup SHOULD be such that it could validly appear directly within an HTML <DIV> element. Receiving software which displays the content SHOULD use the markup to aid in displaying it.

  3. If the value of "type" is "XHTML", the content of atom:content MAY contain child elements. The content SHOULD be XHTML text and markup that could validly appear directly within an xhtml:div element. Receiving software which displays the content SHOULD use the markup to aid in displaying it.

  4. If the value of "type" ends with "+xml" or "/xml", the content of atom:content may include child elements, and SHOULD be suitable for handling by software that knows the indicated media type. If the "src" attribute is not provided, this would normally mean that the "atom:content" element would contain a single child element which would serve as the root element of the XML document of the indicated type.

  5. If the value of "type" begins with "text/" the content of atom:content MUST NOT contain child elements.

  6. For all other values of "type", the content of atom:content MUST be a valid base64 encoding [RFC3548], which when decoded SHOULD be suitable for handling by software that knows the indicated media type. In this case, the characters in the base64 encoding may be preceded and followed in the atom:content element by whitespace, and lines are separated by a single newline (U+000A) character, as required by XML.

Example

   <feed version="draft-ietf-atompub-format-01: do not deploy"
    xmlns="http://purl.org/atom/ns#draft-ietf-atompub-format-01">
     <head>
       <title>Example Feed</title>
       <link rel="alternate" type="text/html"
        href="http://example.org/index.atom"/>
       <modified>2003-12-13T18:30:02Z</modified>
       <author>
         <name>John Doe</name>
       </author>
     </head>
     <entry>
       <title>How to use &lt;style></title>
       <id>tag:example.org,2003:3.2397</id>
       <updated>2003-12-13T18:30:02Z</updated>
       <summary type="HTML">A lengthy discourse on do&amp;rsquo;s and
       don&amp;rsquo;t&amp;rsquo;s for the HTML &amp;lt;style> element</summary>
       <content src="http://example.com/htmlessons/style" />
     </entry>
     <entry>
       <title type="TEXT">How to use &lt;BLINK></title>
       <id>tag:example.org,2003:3.2398</id>
       <updated>2003-12-13T18:30:02Z</updated>
       <summary>Don&#x2019;t!</summary>
       <!-- note no content -->
     </entry>
     <entry>
       <!-- if it were type="HTML" you'd have to say "&amp;lt;hr/>" -->
       <title>How to use &lt;hr /></title>
       <id>tag:example.org,2003:3.2399</id>
       <updated>2003-12-13T18:30:02Z</updated>
       <!-- no summary; OK because content is here -->
       <content>&lt;hr /> is a strictly graphical element 
       which draws a horizontal line. &lt;hr />, &lt;hr/>, and &lt;hr>&lt/hr> 
       are all equivalent strictly speaking, but the first form is the most
       common.</content>
     </entry>
     <entry>
       <title>Summer...</title>
       <id>tag:example.org,2003:3.2400</id>
       <updated>2003-12-13T18:30:02Z</updated>
       <summary>The last cherry tomatoes of summer.  Look at the vivid
       reproduction of the many shades of red.</summary>
       <content type="image/jpeg" src="http://example.com/pix/ct.jpg" />
     </entry>
     <entry>
       <title>Small Red Dot</title>
       <id>tag:example.org,2003:3.2401</id>
       <updated>2003-12-13T18:30:02Z</updated>
       <summmary>One red pixel in a 5x5 grid.</summary>
       <content type="image/gif">
       R0lGODlhBQAFAJEAAAAAAP////8AAAAAACwAAAAABQAFAAACBYyPJslRADs=
       </content>
     </entry>
   </feed>

Impacts

Notes

CategoryProposals