Subject: Attributes on the xhtml:div wrapper

From: David Powell <[email-masked]>
Date: Wed, 16 Mar 2005 22:57:41 +0000

I think that there is a risk of interoperability problems if we don't state which attributes are allowed on the xhtml:div wrapper.

As the xhtml:div wrapper is not part of the content: is it allowed to contain XHTML attributes such as class and style?

I assume that if these attributes are allowed, then they should be ignored by renderers, and the attributed xhtml:div should be treated as an un-attributed one.

However, as xml:lang definitions made outside the content construct apply to the XHTML, I would assume that xml:lang attributes made on the xhtml:div itself, should apply to the XHTML.

If I've got this right, then I think that these implied rules are rather surprising.

Should we:

  a) keep the current text.

  b) disallow attributes on the xhtml:div wrapper.

  c) disallow XHTML attributes on the xhtml:div wrapper, but
     allow xml:lang.

I vote for b).

Allowing xml:lang on xhtml:div is unnecessary because it can be placed on the content construct itself with the same effect.  Allowing attributes on a wrapper element which most people would otherwise just throw away adds unnecessary complexity and surprise.

-- 
Dave

---

From: Antone Roundy <[email-masked]>
Date: Wed, 16 Mar 2005 22:46:39 -0700

On Wednesday, March 16, 2005, at 03:57  PM, David Powell wrote:
> Allowing xml:lang on xhtml:div is unnecessary because it can be placed 
> on the content construct itself with the same effect.  Allowing 
> attributes on a wrapper element which most people would otherwise just 
> throw away adds unnecessary complexity and surprise.
>
I imagine this is what you meant by b), but just to be sure, I'd vote 
for d) disallow attributes other than namespace declarations on the 
xhtml:div wrapper.

---

From: Martin Duerst <[email-masked]>
Date: Thu, 17 Mar 2005 15:38:18 +0900

Mildly put, I was never a big fan of the xhtml:div wrapper.

But if xml:lang is disallowed on the xhtml:div wrapper, this
makes even less sense to me. If Atom processors can handle
(i.e. correctly inherit) xml:lang from atom: elements into
the xhtml: elements as they are required to, I don't see
why they wouldn't be able to handle xml:lang on xhtml:div.

Regards,    Martin.

 >> Allowing xml:lang on xhtml:div is unnecessary because it can be placed 
on the content construct itself with the same effect.  Allowing attributes 
on a wrapper element which most people would otherwise just throw away adds 
unnecessary complexity and surprise.
 >>
 >I imagine this is what you meant by b), but just to be sure, I'd vote for 
d) disallow attributes other than namespace declarations on the xhtml:div 
wrapper.

---

From: David Powell <[email-masked]>
Date: Thu, 17 Mar 2005 09:09:04 +0000

>>   b) disallow attributes on the xhtml:div wrapper.
...

> for d) disallow attributes other than namespace declarations on the 

Yes, namespace attributes should be allowed everywhere. XML parsers
handle namespace attributes automatically so there shouldn't be any
problems with that.

-- 
Dave

---

From: David Powell <[email-masked]>
Date: Thu, 17 Mar 2005 09:08:28 +0000

> Regards,    Martin.

This issue interacts with the issue in my other thread "xml:base and
xml:lang".

If we change the spec to say something like:

> Any atom-namespaced element in the Atom Document MAY have an
> xml:base attribute.
>
> Any atom-namespaced element in an Atom Document MAY have an xml:lang
> attribute

Then the implication is that we are saying nothing about what
attributes are allowed on XHTML-namespaced elements, and that is left
for XHTML to define.

But, I think that we should disallow xhtml attributes on the
xhtml:div, otherwise implementors that copy the xhtml:div directly
through to the renderer will be incorrect.

So we either say:

1)

  atom:* elements MAY have xml:base and xml:lang attributes.

  The xhtml:div wrapper MUST NOT contain any attribute other than
  namespace attributes.

or:

2)

  atom:* elements MAY have xml:base and xml:lang attributes.

  The xhtml:div wrapper MUST NOT contain any attribute other than
  namespace attributes and xml:lang.

-- 
Dave

---

From: "Thomas Broyer" <[email-masked]>
Date: Thu, 17 Mar 2005 11:21:22 +0100 (CET)

David Powell wrote:
> I think that there is a risk of interoperability problems if we don't
> state which attributes are allowed on the xhtml:div wrapper.
>
>
> As the xhtml:div wrapper is not part of the content: is it allowed to
> contain XHTML attributes such as class and style?
>
> I assume that if these attributes are allowed, then they should be
> ignored by renderers, and the attributed xhtml:div should be treated as
> an un-attributed one.

What about:
<atom:content type="xhtml">
  <div xmlns="http://www.w3.org/1999/xhtml">
    <p style="position: absolute; top: 0; left: 0; width: 100%; height:
100%">
      Hey, hey! I can show ads that can take the whole viewport, hiding
everything else in the containing page! (if the feed content is
shown inside another HTML page)
    </p>
  </div>
</atom:content>

Moreover, you can still add constraints on the XHTML content but you'll
never be able to constraint HTML content...

Maybe that's why NITF (or its subset XMLNews-story) defines its own
formatting markup... though NITF also adds semantic markup (location,
person, etc.)

Anyway, the -06 spec says XHTML is used in its "basic" flavor (and that's
good! <applause/>), not allowing inline styles (but still the class
attribute) nor the script element.
Though you can still not put such constraints on type="html" content, and
this moves the interop' matter elsewhere: publishers are then required to
check and filter their XHTML content (or they'll just put it in
type="html" to bypass the validation process... worse than everything
else...) before including it in an Atom feed...

Oh, and as we're talking about it: the -06 spec states "If the value of
"type" is "xhtml", the content of the Text construct MUST be a single
XHTML div element" but the RNG schema says it can contain mixed content
with "anyElement".

However, I still can't understand the _need_ for this xhtml:div wrapper...
if someone likes to have a prefix-free feed, he can use a wrapper div, as
divs can contain divs!
So please revert to "mixed content without wrapper"! (I know it's too
late...)

-- 
Thomas Broyer

---

From: Bill de hÓra <[email-masked]>
Date: Thu, 17 Mar 2005 11:09:38 +0000

> why they wouldn't be able to handle xml:lang on xhtml:div.

I think anyone who was not a fan of xhtml:div should argue against 
allowing xml:lang or any other attributes on it. In a few years it'll be 
obvious that xhtml:div was a needless band-aid - adding extra 
characteristics to it now serves only to make it harder to zero it out 
later.

cheers
Bill

---

From: Antone Roundy <[email-masked]>
Date: Thu, 17 Mar 2005 07:58:17 -0700

> attribute) nor the script element.
First, just curious--did we discuss which flavor of XHTML was to be 
allowed?  I'm not familiar enough with the differences to comment on 
what I'd prefer.

Second, looking at http://www.w3.org/TR/2000/REC-xhtml-basic-20001219/, 
I see that the style ELEMENT is not supported, but it doesn't say that 
the style ATTRIBUTE is not supported.  By "inline styles", are you 
referring to only what's done in the style element, and not what's done 
in the style attribute?

---

From: "Thomas Broyer" <[email-masked]>
Date: Thu, 17 Mar 2005 17:21:00 +0100 (CET)

Antone Roundy wrote:
> the style ATTRIBUTE is not supported.

That's right, you have to go through the (not much readable, due to
XHTMLMOD) DTD, which doesn't include the "Style Attribute Module".

> By "inline styles", are you referring to only what's done in the style
> element, and not what's done in the style attribute?

I was referring to the style attribute.

-- 
Thomas Broyer

---

From: Antone Roundy <[email-masked]>
Date: Thu, 17 Mar 2005 09:37:01 -0700

On Thursday, March 17, 2005, at 09:21  AM, Thomas Broyer wrote:
> Antone Roundy wrote:
>> Second, looking at 
>> http://www.w3.org/TR/2000/REC-xhtml-basic-20001219/,
In that case, if we're going to spec the use of basic xhtml, I think 
we'd better make an explicit note of this point, because the 
probability is high that many people will miss it entirely--perhaps 
something along the lines of "Note that basic XHTML is a subset of 
XHTML and does not support certain elements and attributes such as the 
style attribute."

---

From: Tim Bray <[email-masked]>
Date: Thu, 17 Mar 2005 09:01:13 -0800

> why they wouldn't be able to handle xml:lang on xhtml:div.

+1 -Tim

---

From: Robert Sayre <[email-masked]>
Date: Thu, 17 Mar 2005 12:12:36 -0500

>> why they wouldn't be able to handle xml:lang on xhtml:div.

+1 as well. 90% of developers are going to drop xml:lang on the floor 
anyway. The other 10% will get it right if it's on the div wrapper.

Robert Sayre

---

From: Tim Bray <[email-masked]>
Date: Thu, 17 Mar 2005 09:18:28 -0800

On Mar 17, 2005, at 1:08 AM, David Powell wrote:

> xhtml:div

-1, unless you can provide actual real examples of actual real problems 
that this prevents. --Tim

---

From: Julian Reschke <[email-masked]>
Date: Thu, 17 Mar 2005 18:43:52 +0100

> that this prevents. --Tim

The underlying issue here (afaik) is that we've been told that the 
mandatory is /not/ part of the content, thus I wouldn't expect 
recipients to store it in any way. So what happens if attributes carry 
inheritable information?

Best regards, Julian

-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---

From: Antone Roundy <[email-masked]>
Date: Thu, 17 Mar 2005 10:48:13 -0700

On Thursday, March 17, 2005, at 10:18  AM, Tim Bray wrote:
> -1, unless you can provide actual real examples of actual real 
> problems that this prevents. --Tim
>
If we're going to be using a flavor of XHTML that doesn't support 
@style, then this example is invalid, but perhaps the concept can be 
transferred to some other attribute.  This example assumes that the 
XHTML namespace is already bound to the prefix "x":

<content type="XHTML"><x:div style="color:#f00;">Am I red 
text?</x:div></content>

Should the text be rendered in red or not?  The div and its style 
attribute are not part of the content, so do they have the ability to 
style the content?  When I hand the content off to my XHTML rendering 
widget, how would I tell it about the red style if I've removed the 
wrapper div?  I haven't worked with such widgets, so for all I know, 
there may be an obvious answer to that--at least for some widgets.  But 
still, applications are going to have to know more about XHTML than 
they'd have to know if they could simply discard the wrapper and pass 
its contents on to their XHTML widget.

---

From: Thomas Broyer <[email-masked]>
Date: Thu, 17 Mar 2005 21:54:40 +0100

Antone Roundy a écrit :
> Should the text be rendered in red or not?

The question is: should the text should be rendered using any 
publisher-provided style or using the Atom processor's style, or the 
including web page's style (if I'm publishing someone else's feed on my 
own website) ?
Is Atom a _news_ syndication format ? And maybe something like 
NITF/XMLNews-story would be a better choice.
Or is Atom a _web_ syndication format ? And XHTML is a good choice.
Or is Atom a _publication_ format ? And DocBook/XML would be a good choice.

 > The div and its style

...hmm, or maybe we shouldn't have introduced the wrapper and we could 
simply rollback...

-- 
Thomas Broyer

---

From: Henri Sivonen <[email-masked]>
Date: Fri, 18 Mar 2005 03:45:51 +0200

>   c) disallow XHTML attributes on the xhtml:div wrapper, but

If you allow declaring the language, why do you disallow declaring the 
dominant writing direction (dir)? Shouldn't they be allowed or 
disallowed together?

d) Get rid of the wrapper div.

-- 
Henri Sivonen
[email-masked]
http://hsivonen.iki.fi/

---

From: Julian Reschke <[email-masked]>
Date: Fri, 18 Mar 2005 06:40:08 +0100

> d) Get rid of the wrapper div.

+1 (as far as I can tell, it makes things more complicated, not simpler)