Subject: Trade mandatory xhtml:div for atom:content/@container?

From: Antone Roundy <[email-masked]>
Date: Fri, 15 Apr 2005 15:15:23 -0600

In case the idea was buried too deeply in my prior email[1], here it is 
in it's own message:

Could we drop the xhtml:div requirement in content[@type="xhtml"], and 
instead clarify the status of the div that is commonly being put there 
(is it part of the content or not?) by adding an attribute to 
atom:content as follows:

<content type="xhtml" container="dispose">
	<div xmlns="http://www.w3.org/1999/xhtml">This is XHTML content in a 
throwaway div.</div>
</content>

<content type="xhtml" container="none" 
xmlns:xh="http://www.w3.org/1999/xhtml">
	<xh:p>This is the first paragraph of XHTML content with no container 
element inside atom:content.</xh:p>
	<xh:p>This is the second paragraph.</xh:p>
</content>

<content type="xhtml">
	<div xmlns="http://www.w3.org/1999/xhtml" style="color:#c00;">
		This is XHTML content in a div which IS part of the content, assuming 
the default value for @container is "none".
	</div>
</content>

If @container="dispose", atom:content MUST have a SINGLE child element 
which is NOT to be treated as part of the content, but is just a 
container.  If @container="none" (or @container is omitted), then 
everything in atom:content is considered part of the content.  
@container="dispose" is only legal for XML types, whether "XHTML", or a 
MIME type ending in "/xml" or "+xml".

Other than this being last minute, are there any drawbacks to this 
approach?  Are there better names for the attribute?  Better values for 
it?  Is "none" a good default?

[1] http://www.imc.org/atom-syntax/mail-archive/msg14228.html

---

From: "A. Pagaltzis" <[email-masked]>
Date: Fri, 15 Apr 2005 23:56:32 +0200

* Antone Roundy <[email-masked]> [2005-04-15 23:25]:
> @container="dispose" is only legal for XML types, whether
> "XHTML", or a MIME type ending in "/xml" or "+xml".

Of course, @container would then obviate the need for treating
XHTML any differently from other XML types (apart from the “how
do I discover the type of the content” problem discussed in the
previous thread).

Regards,
-- 
Aristotle

---

From: Thomas Broyer <[email-masked]>
Date: Sat, 16 Apr 2005 00:15:16 +0200

Antone Roundy wrote:
> Could we drop the xhtml:div requirement in content[@type="xhtml"],

+1

> and instead clarify the status of the div that is commonly being put
> there (is it part of the content or not?)

+1

> by adding an attribute to atom:content

-1

Let me explain my point of view:
With @type="text" there is no container, neither with @type="html", so 
why should there be a container with @type="xhtml"?
Just for carrying the xmlns declaration? Well, you'd better define it 
once in the feed element...
Just to allow for prefix-free Atom documents? See below about "legacy 
Atom" documents.

So what about those existing Atom documents (0.3 or 
draft-ietf-atompub-format-07) using a div container? Well, keep them as 
they are!
What's the matter with having the entry content inside an XHTML div, 
itself being considered part of the content?
A div element in (X)HTML has only a structural meaning. If the entry 
content is to be rendered as part of an XHTML document (as in a Web 
aggregator, or in a blog for example when Atom is used as a publishing 
protocol/syntax) and included inside a div element, the duplicate divs 
won't change anything to the document structure, there'll just be a 
needless duplicate div...
So someone willing to use a div container in its Atom documents (e.g. to 
produce prefix-free documents, by declaring the XHTML namespace on the 
div) can do it as it won't change anything!

-- 
Thomas Broyer

---

From: Antone Roundy <[email-masked]>
Date: Sat, 16 Apr 2005 12:08:25 -0600

>> by adding an attribute to atom:content
...
> why should there be a container with @type="xhtml"?

Because it's XML in XML, which raises issues that don't exist for 
"text" and "html".

Some people prefer to switch default namespace when doing XML in XML. 
If the XHTML content they're putting into atom:content isn't already 
surrounded by a single element where that switch can be made, adding a 
container to hold the namespace declaration is a common way of doing it.

> once in the feed element...

You can argue that that's a better method, but we have already 
discussed and rejected the idea of mandating that the namespace be 
declared in a particular place or a particular way.

> draft-ietf-atompub-format-07) using a div container? Well, keep them 
> as they are!

See http://www.imc.org/atom-syntax/mail-archive/msg14238.html for my 
response.

I don't think we're going to oust the required container div unless we 
replace it with something.  Between the options of having a required 
container div and having an optional attribute to indicate whether 
you're using a container div, which would you prefer?

---

From: Thomas Broyer <[email-masked]>
Date: Sun, 17 Apr 2005 00:54:12 +0200

Antone Roundy wrote:
>> With @type="text" there is no container, neither with @type="html",
>>  so why should there be a container with @type="xhtml"?
> 

Yes, but it's still "content".

>  surrounded by a single element where that switch can be made, adding
>  a container to hold the namespace declaration is a common way of 
> doing it.

...so they can use meaningless divs or spans containers, depending
whether they have block or inline content.

And some people prefer having a clean, needless-container-free feed,
using prefixes and declaring namespaces in the enclosing element (or any
of its ancestors).

>> Just for carrying the xmlns declaration? Well, you'd better define
>>  it once in the feed element...
> 

I'm not trying to mandate anything!

And you're right: I'm just arguing that that's a better method.

>> What's the matter with having the entry content inside an XHTML
>> div, itself being considered part of the content? A div element in
>> (X)HTML has only a structural meaning. If the entry content is to
>> be rendered as part of an XHTML document (as in a Web aggregator,
>> or in a blog for example when Atom is used as a publishing
>> protocol/syntax) and included inside a div element, the duplicate
>> divs won't change anything to the document structure, there'll just
>> be a needless duplicate div...
> 
> 

And putting a title in a div, therefore allowing paragraphs in it, does
not disturb you?

> I don't think we're going to oust the required container div unless 
> we replace it with something.  Between the options of having a 
> required container div and having an optional attribute to indicate 
> whether you're using a container div, which would you prefer?

The third option: using a "div" container when I want block- and "span" 
when I want inline-content.

However, I personally actually prefer using an "atom" prefix for Atom 
elements and no prefix for XHTML...

-- 
Thomas Broyer