Re: XHTML served as application/xml+xhtml

From: "Richard Ishida" <ishida@w3.org>
> Following our discussion last Friday I proposed to amend the Q&A at
> http://www.w3.org/International/questions/qa-bidi-css-markup.html by
> inserting a second para in the section Answer -> XHTML/HTML that reads
> as follows:
>
> ======================
> (There is an exception to this rule. If the XHTML is served as
> <code>application/xhtml+xml</code>, rather than <code>text/html</code>
> it is treated by the user agent as XML rather than HTML, and so needs
> CSS to map the markup to the appropriate display behaviour, as described
> in '<a href="#xml">General XML-based markup languages</a>' above.)
>
>  ======================
>
> Some questions were raised about its validity in our GEO telecon. Would
> you mind casting an eye over this para and letting us know whether it
> looks correct / adequate to you?

(Sorry about the delay in replying)

I think there is a confusion here about what determines whether a document
is HTML or XHTML.

Let me try and explain: if I serve up an HTML document as text/plain, it
becomes a text document, not an HTML document, and the rules for text/plain
apply to it, not the rules for text/html. (IE does this wrong by the way).

If I serve up an XHTML document as text/html, it becomes an HTML document,
not XHTML, and so the rules for HTML apply (including the ones in CSS).

If I serve an XHTML document as application/xhtml+xml (or text/xml), only
then is it really XHTML, and the HTML rules no longer apply.

So there is nothing wrong with the new paragraph, it is the paragraph that
it applies to that is wrong in bundling HTML and XHTML together. They are
different beasts, and should have different sections.

So this paragraph is wrong:

<<<
XHTML/HTML

Use markup only. The CSS2 recommendation recommends the use of markup for
bidi text in HTML. In fact it goes as far as to say that conforming HTML
user agents may ignore CSS bidi properties. This is because the HTML
specification clearly defines the expected behaviour of user agents with
respect to the bidi markup.
>>>

Replace it with something like:

<<<
HTML

Use markup only. The CSS2 recommendation recommends the use of markup for
bidi text in HTML. In fact it goes as far as to say that conforming HTML
user agents may ignore CSS bidi properties. This is because the HTML
specification clearly defines the expected behaviour of user agents with
respect to the bidi markup.

XHTML

XHTML (served as text/xml, application/xml or application/xhtml+xml) is XML
and so needs CSS to map the markup to the appropriate display behaviour, as
described in '<a href="#xml">General XML-based markup languages</a>' above.
Note that an XHTML document served as text/html is treated as an HTML
document, not an XHTML one, and so the HTML rules apply, not the XHTML ones.
>>>

Hope this helps.

Best wishes,

Steven Pemberton

Received on Friday, 22 August 2003 11:41:36 UTC