UserPreferences

PaceXhtmlDivSuggestedOnly


Abstract

Make the XHTML div wrapper optional, as it causes more problems than it actually solves.

Status

Open

Rationale

The only purpose of the XHTML div wrapper is to have it carry the XHTML namespace declaration in case the feed producer doesn't want to use prefixed XML names (i.e. always use default namespaces). The required wrapper is also expected to prevent feeds using wrong namespaces.

On the other hand, there has been many discussion about which attributes are allowed/forbidden on the wrapper and how they should be handled by Atom processors, without a clear and clean solution.

Using a XHTML "div" element is also quite inappropriate in an atom:title element as a "div" is meant for block content whereas a title is merely expected to be used as inline content (e.g. by putting it inside an "h2" or "h3" XHTML element). This has no technical impact in the current spec as the div is not part of the content but it might disturb XHTML-friendly people.

Finally, mandating a "foreign" (outside the Atom namespace) element but requiring it not being part of the content and not behaving as it would in its originating language (XHTML) is not a clean position: so is this element part of Atom or XHTML?

Proposal

Nuke the XHTML div requirement and adds distinction between inline and block content to help producers choose the best container for their content (div or span).

This means making the following changes/addition to the draft-ietf-atompub-format-08 document.

section 3.1

Change the atomXHTMLTextConstruct definition to this one:
   atomXHTMLTextConstruct =
      atomCommonAttributes,
      attribute type { "xhtml" },
      (text
       | anyXHTML)*
And add the following paragraph:
   This specification further refines the Text construct depending on
   the kind of content that is expected. A Text constructs expecting
   inline content is further named Inline Text construct, whereas a
   Text construct expecting block content is named Block Text construct.

section 3.1.1.2

Replace the last paragraph with:
   If the value of "type" is "html", the content of the Text construct
   MUST NOT contain child elements, and SHOULD be suitable for handling
   as HTML [HTML].  Any markup within MUST be escaped; for example,
   "<br>" as "&lt;br>". Atom Processors that display such content MAY
   use that markup to aid in its display.

   The content is subject to further constraints depending on its kind:

   o  HTML markup within an Inline Text construct SHOULD be such that
      it could validly appear directly within an HTML <SPAN> element,
      after unescaping.
   o  HTML markup within a Block Text construct SHOULD be such that
      it could validly appear directly within an HTML <DIV> element,
      after unescaping.

section 3.1.1.3

   Example atom:title with XHTML content:

   ...
   <title type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">
       Less: <xhtml:em> &lt; </xhtml:em>
   </title>
   ...

   If the value of "type" is "xhtml", the content of the Text construct
   MUST be XHTML [XHTML] text and markup. Atom Processors which display
   the content MAY use the markup to aid in displaying it.  Escaped
   characters, such as "&" and ">", represent those characters, not
   markup.

   The content is subject to further constraints depending on its kind:

   o  the content of an Inline Text construct MUST be XHTML text and
      markup that could validly appear within an XHTML span element.
   o  the content of a Block Text construct MUST be XHTML text and
      markup that could validly appear within an XHTML div element.

   Examples of valid XHTML content:

   ...
   <title type="xhtml">
      <span xmlns="http://www.w3.org/1999/xhtml">
         This is an <b>XHTML</b> title
      </span>
   </title>
   <summary type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
         <p>
            Note that using <code>span</code> and <code>div</code>
            containers allows us to keep using default namespaces
            (namespaces not bound to any prefix).
         </p>
         <p>
            The container element has been choosen to fit the kind of
            content it contains: <code>span</code> for inline content
            and <code>div</code> for block content.
         </p>
      </div>
   </summary>
   ...
   <summary type="xhtml">
      <xhtml:p xmlns:xhtml="http://www.w3.org/1999/xhtml">
         This is an <xhtml:b>XHTML</xhtml:b> paragraph.
      </xhtml:p>
   </summary>
   ...

   The following example assumes that the XHTML namespace has been bound
   to the "xh" prefix earlier in the document:

   ...
   <summary type="xhtml">
      This is <xh:b>XHTML</xh:b> content.
   </summary>
   ...

section 4.1.3 The "atom:content" Element

Replace the atomInlineXHTMLContent definition with this one:
   atomInlineXHTMLContent =
      element atom:content {
         atomCommonAttributes,
         attribute type { "xhtml" },
         anyXHTML
      }

section 4.1.3.3 Processing Model

Replace third list item with this one:
   3.  If the value of "type" is "xhtml", the content of atom:content
       MUST be XHTML [XHTML] XHTML text and markup that could validly
       appear within an XHTML div element. Atom Processors that
       display the content MAY use the markup to aid in displaying it.
       Escaped characters, such as "&" and ">", represent those
       characters, not markup.

section 4.2.4 The "atom:copyright" Element

In the first paragraph, replace "Text construct" with "Inline Text construct".

section 4.2.12 The "atom:subtitle" Element

In the first paragraph, replace "Text construct" with "Inline Text construct".

section 4.2.13 The "atom:summary" Element

In the first paragraph, replace "Text construct" with "Block Text construct".

section 4.2.14 The "atom:title" Element

In the first paragraph, replace "Text construct" with "Inline Text construct".

Impacts

Producers of Atom documents based on the IETF drafts and using XHTML content will have to either:

Notes

The "wrong namespace use" concern is answered in the second example, some might prefer making it clearer by putting the example description in its own spec paragraph and have the example only an illustration.


CategoryProposals