Abstract
Replace the requirement for an xhtml:div wrapper for content[@type="xhtml"] with an optional attribute to indicate whether the top level element of XML content is a disposable wrapper or part of the content.
Status
Open
Rationale
-
When embedding XML in XML, the inner XML content is often wrapped in an extra element from the content's namespace in order to provide a place to declare the inner XML's namespace (whether making it the default namespace or not).
-
Unless there is a method to specify whether such a wrapper element has been added to the inner content, the status of the outer element of the inner content is ambiguous. Is it part of the content, or not?
-
In requiring a wrapper div for XHTML content, the current draft resolves this question only for XHTML content.
-
...and it resolves it by a method to which a number of people object.
-
One objection is that it uses a block element in Atom elements intended to carry inline content, such as atom:title.
-
This proposal creates an alternative method which would work for all XML content types, and which only requires adding to the feed when action (disposing of the wrapper, or otherwise recognizing that it's not part of the content) is required.
Proposal
Add the following under section 3.1 of draft-ietf-atompub-format-08.txt:
3.1.2 The "wrapper" Attribute
-
Text constructs MAY have a "wrapper" attribute if the value of the "type" attribute is "xhtml". When present, the value MUST be one of "none" or "dispose". If the "wrapper" attribute is not provided, Atom Processors MUST behave as though it were present with a value of "none".
If the value is "dispose", the Text construct MUST have only a single element child, which Atom Processors MUST treat as a disposable wrapper for the XHTML content, and not as part of the content itself. The wrapper element MUST NOT have any attributes other than namespace declarations. If the value is "none", Atom Processors MUST NOT treat any element children of the Text construct as disposable wrapper elements.
Add the following under section 4.1.3:
4.1.3.2 The "wrapper" Attribute
-
The atom:content element MAY have a "wrapper" attribute if the value of the "type" attribute is "xhtml" or a MIME media type ending in "/xml" or "+xml". When present, the value MUST be one of "none" or "dispose". If the "wrapper" attribute is not provided, Atom Processors MUST behave as though it were present with a value of "none".
If the value is "dispose", atom:content MUST have only a single element child, which Atom Processors MUST treat as a disposable wrapper for the content, and not as part of the content itself. The wrapper element MUST NOT have any attributes other than namespace declarations. If the value is "none", Atom Processors MUST NOT treat any element children of atom:content as disposable wrapper elements.
Remove the requirement for an XHTML div from sections 3.1.1.3 and 4.1.3.3, item 3, and adjust the example feeds as appropriate.
Impacts
Publishing tools now using wrapper elements would need to add an attribute to the containing elements, and consumers would need to key their treatment of the outermost element in XML content off it's value.
Notes
-
"wrapper" could be "container" or some such thing.
-
The attribute could be allowed regardless of the value of @type, but only be meaninful if @type indicates an XML type.