On a recent project I've been using HTML 4.01 Transitional because of some older markup that I didn't have time to update. I have been using the closing tag syntax of <tag ... /> and that is giving a warning with this HTML doctype. If I change to XHMTL 1.0 Transitional to handle this syntax, other things break (I don't remember exactly what now, just that it was going to be painful to fix).

So... what is the doctype of tomorrow? Will everything be XHTML? Is it stupid to use HTML 4.01 Transitional? What about HTML 4.01 Strict?

Andrew Johnson

02-19-2008, 05:37 PM

Generally web developers are saying XHTML is the future, although there is a select few rallying behind HTML. We'll have to wait for XHTML 2/HTML 5/Web Applications 1 before we can all choose sides.

I either use XHTML Strict or Transitional. I was using Strict exclusively, but was recently made aware that you can't use the TARGET attribute in A tags without going for Transitional. So nowadays I am using Transitional exclusively.

However, as soon as the next wave comes out this all may change.

Bill Posters

02-19-2008, 06:21 PM

I use Strict exclusively, typically XHTML Strict.
I've yet to find a convincing reason to use those attributes which require me to use Transitional. (I never use framesets/iframes and am convinced that new windows are better provided by scripting, on the few occasions that they may benefit a site and/or its users.)

Strict provides the very best chance of x-browser consistency in terms of standards-compliant rendering, so even on the rare occasions when I might be tempted to use an iframe (only ever c/o thickbox et al) or a hard-coded target attribute (PDFs, maybe), it's not beyond the realms of possibility that I might use a Strict DTD with a few, non-critical invalidations in the markup or c/o the scripting, than to drop down to a Transitional doctype. The use of a Transitional doctype is likely to have a greater impact on x-browser rendering than a nominal use of invalid markup such as an iframe or target attribute.

I appreciate that some may consider this position a touch blasphemous, but I still consider myself a web standards advocate.

I don't expect my practises to change significantly in the near future, but like Andrew, it seems, I'll be keeping an eye on the progress made in discussions about XHTML 2 and HTML 5.

Andrew Johnson

02-19-2008, 06:36 PM

I am convinced that new windows are better provided by scripting

How do you come to that conclusion?

_Aerospace_Eng_

02-19-2008, 06:43 PM

How do you come to that conclusion?

Just read this
http://www.codingforums.com/showthread.php?t=117463

liorean

02-19-2008, 07:03 PM

Let's see if I can explain it:

HTML4.01 is:
- A vocabulary of element names, attribute names, entitiy names, allowed attribute values, attribute content models, and element content models.
- A set of semantics that apply to that vocabulary.
- A set of three different SGML DTDs to use for confirming that a document conforms to the HTML4.01 vocabulary.

XHTML1.0 is:
- A set of three different XML DTDs to use for confirming that a document conforms to the vocabulary of HTML4.01.
- An XML namespace to associate the semantics of HTML4.01 with the vocabulary of HTML4.01 in an XML serialisation.

In both cases, the question of syntax is offloaded to another spec, SGML and XML respectively.

Now, there's another factor: Content-Type. As you see, XHTML contains a way to explain which semantics a document has (the XHTML namespace). HTML does not have such a marker. Instead, all documents that are served using Content-Type "text/html" are considered to be HTML, and use the HTML semantics. For XHTML, documents served using any XML Content-Type, such as "application/xhtml+xml" or "application/xml" will use the XML namespace to know which semantics to apply to a document.

If you haven't realised it already: HTML4.01 and XHTML1.0 are the same semantics, and the same vocabulary. They just have two different syntaces: SGML for the former, XML for the latter. They are the same language!

Just choose which syntax you're going to use: HTML/SGML (since none of the browsers treat it like SGML, could as well call it the HTML format instead, as for HTML5) or XML.

Bill Posters

02-19-2008, 07:17 PM

Just read this
http://www.codingforums.com/showthread.php?t=117463

Jeez, was that really less than a year ago?
Seems like much, much longer ago.

Apostropartheid

02-20-2008, 12:15 AM

I either use XHTML 1 Strict or 1.1, or nothing and use
<!doctype html> to trigger standards mode when I'm offline and validation is an unnecessary thing (like quickly throwing together files for this lot =P)

Bill Posters

02-20-2008, 08:33 AM

I either use XHTML 1 Strict or 1.1

Interesting. I've yet to find a good reason to use 1.1.
I used to play around with it a couple of years back, but decided that it offered no substantial benefits over serving XHTML 1.0 Strict as a/x+x.
(I presume that you're aware that the spec does not allow for 1.1 to be served as text/html, which is permitted à la App. C. which I sometimes use c/o content negotiation when conditions permit.)

For which sites / situations do you use 1.1?

Apostropartheid

02-20-2008, 06:30 PM

For which sites / situations do you use 1.1?
I rarely do--if so, it's for my personal sites and, even then, I check out whether application/xhtml+xml is supported (or whether it's IE7) before setting the DTD as such, with an XML prologue. Else it falls back to XHTML 1 served as html.