homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Two New W3C Documents: 21 July 2004
Intro to and the why of xhtml and xml

 3:58 am on Jul 22, 2004 (gmt 0)

Two new "overview" type documents from W3C:

HTML and XHTML Frequently Answered Questions
[w3.org ]

XML Events for HTML Authors
[w3.org ]

Basic but helpful if you are new to (or wondering why) xhtml and/or xml.

And of course links that go on forever if you get interested and start reading and clicking and reading and clicking ...



 5:57 am on Jul 22, 2004 (gmt 0)

Nice find

Some interesting info in the articles.


 7:07 am on Jul 22, 2004 (gmt 0)

Theres a nice little trick in the first one to get around the application/xhtml+xml issue with Internet Explorer.


 12:05 pm on Jul 22, 2004 (gmt 0)

From the first document:

Why is it disallowed to send XHTML 1.1 documents as text/html?

XHTML 1.1 is pure XML, and only intended to be XML. It cannot reliably be sent to legacy browsers. Therefore XHTML 1.1 documents must be sent with an XML-related media type, such as application/xhtml+xml.

Hmmm, I remember arguing with DrDoc about this a few months ago (I lost the argument, as one tends to do with DrDoc). I thought XHTML 1.1 couldn't be served as text/html, and he pointed out the W3C documentation showing that it could. Now this document says you can't - but it is only a FAQ, not a technical specification.

So who's right now? Does anybody know for sure?


 12:11 pm on Jul 22, 2004 (gmt 0)

You can send XHTML1 as text/html (with conditions, such as using <br /> instead of <br/>).

XHTML1.1 should not be sent as text/html. HTML compatible XHTML1.1 doesn't exist.


 12:32 pm on Jul 22, 2004 (gmt 0)

Interesting links which I followed to here:

As much as I think html forms need to be improved, I don't like their suggested implementation with XForms. Now in order to create a form you need to insert data into the head tag? Are they nuts? Don't they know that there's a ton of software out there with templates that are interchangeable and the headaches of getting extra data into the head would break a lot of software.


 1:26 pm on Jul 22, 2004 (gmt 0)

HTML compatible XHTML1.1 doesn't exist.

That's what I thought - until DrDoc pointed out this:


Note that XHTML 1.0 and 1.1 are marked as "SHOULD NOT" be served as text/html - as opposed to "MUST NOT".

Clark - there is much debate about XForms - many people prefer the WhatWG approach [whatwg.org] rather than the official W3C one regarding forms - but it remains to be seen whether the WhatWG proposals will be adopted as a standard either by W3C (unlikely at this point) or the IETF (possible, but it's early days).


 2:09 pm on Jul 22, 2004 (gmt 0)

However RFC 2854 "The text/html media type":
The text/html media type is now defined by W3C Recommendations; the latest published version is [HTML401]. In addition, [XHTML1] defines a profile of use of XHTML which is compatible with HTML 4.01 and which may also be labeled as text/html.

XHTML1.1 does not define a profile compatible with HTML4.01.

Also, the definition of SHOULD NOT:
SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.

And that W3C link also includes "The 'text/html' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML."

I think it's clear using text/html for XHTML is frowned upon.


 2:45 pm on Jul 22, 2004 (gmt 0)

encyclo, I'll look at that link. I don't know about w3c and any other org, but it will interest me when at least Opera or Mozilla enable such use in their browser. This very box I'm typing in should have more flexibility.


 7:45 pm on Jul 22, 2004 (gmt 0)

There appears to be some confusion:

XHTML 1.0 is a reformation of HTML 4 in XML 1.0 and was purposefully made a transition step that current HTML user agents could understand.

[w3.org ]

The 'text/html' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML. However, as [RFC2854] says, [XHTML1] defines a profile of use of XHTML which is compatible with HTML 4.01 and which may also be labeled as text/html.

Appendix C "HTML Compatibility Guidelines" summarizes design guidelines for authors who wish their XHTML documents to render on existing HTML user agents. The use of 'text/html' for XHTML SHOULD be limited for the purpose of rendering on existing HTML user agents, and SHOULD be limited to [XHTML1] documents which follow the HTML Compatibility Guidelines. In particular, 'text/html' is NOT suitable for XHTML Family document types that adds elements and attributes from foreign namespaces, such as XHTML+MathML

XHTML 1.1 is module based XHTML and might not be understood by current HTML user agents.

The 'application/xhtml+xml' media type [RFC3236] is the media type for XHTML Family document types, and in particular it is suitable for XHTML Host Language document types. XHTML Family document types suitable for this media type include [XHTML1], [XHTMLBasic], [XHTML11] and [XHTML+MathML].

So it is quite simple:

  1. use of xhtml 1.0 and "text/html" is fine. No problem.
  2. use of xhtml 1.1 and "text/html" is not fine.
    • which may cause XML user agents to display incorrectly (as well-formed code is necessary they may well refuse to display anything);
    • and HTML user agents may display incorrectly due to unrecognised code.

  3. use of either xhtml 1.0 or xhtml 1.1 and "application/xhtml+xml" (or similar)
    • HTML user agents will probably be unable to display correctly.
    • XML user agents will have no problem.

use XHTML 1.0 and "text/html" (like many of us do) which displays just fine and wait on replacement xml user agents to become popular before switching to XHTML 1.1.


 9:40 pm on Jul 22, 2004 (gmt 0)

There is a very simple solution for the
text/html vs. application/xhtml+xml issue at the cost of a little extra cpu load. Check if the HTTP_ACCEPT for application/xhtml+xml. If it's there, just send. Else, if it's a user agent known accept it anyway (such as the W3C's validator), again, just send it. Otherwise, do a regex to change each " />" into ">" and then send.

In each case you will also need to send to send the first few lines as appropriate.


 9:45 pm on Jul 22, 2004 (gmt 0)

D'oh, we'd relied on [xml.com...] which says 1.0 may, 1.1 should not, and 2.0 must.


 12:10 am on Jul 23, 2004 (gmt 0)

The problem is not whether one should or shoudn't send XHTML 1.1 as
text/html, but the confusion which appears to reign within the W3C on the matter. There are links in this thread to a number of documents, all originating from w3.org, which give contradictory information.

If the W3C don't even know what the standard is, then how can the rest of us hope to know what to do? It souldn't be a question of personal opinion - it should be laid out clearly in a formal specification.


 12:33 am on Jul 23, 2004 (gmt 0)

If the W3C don't even know what the standard is, then how can the rest of us hope to know what to do?
Good point, but if you always serve the "correct" type the problem is avoided. As far as UA's who can't handle XHTML, send them an HTML version.

 1:14 am on Jul 23, 2004 (gmt 0)

I don't think it really matters if you CAN send 1.1 as text/html because by doing so you loose basically all the extra functionallity that it has.

If you just want to have a page that acts like html then use the 1.0 it can be sent as text/html.

If you need the exrta functionality that 1.1 offers then you CAN'T send it as text/html because the extra functionallity will not work then.

Maybe I am missing something though...


 9:45 pm on Jul 30, 2004 (gmt 0)

All this confusion is why I am still sticking to HTML 4.01 for the forseeable future.....

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved