View Full Version : XHTML 1.0 Strict, what do I need?

08-09-2005, 03:31 AM
Hello all,

I have been using the following doctype for my webpages recently, and all is working fine.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Yet, I have stumbled upon a few other things too, such as the <?xml.... tag preceding that. What does it do? I was always under the impression a DOCTYPE has to come first? How about usability and portability between browsers?

Another thing.. the html tag. I have seen the xmlns attribute, and W3Schools (http://www.w3schools.com/tags/tag_html.asp) revealed to me that it is a fixed value, and does not HAVE to be included. Yet, is it preferable to include it anyway, as I see it being done alot? And how about the xml:lang attribute mentioned there?

These are a lot of questions, but I just can't find any websites that explain it to me in a way that I can understand, especially due to the fact I am quite inexperienced with the more technical sides of XML. To me, it appears like it is saying 'this is xhtml' in a dozen different dialects! :D (I know, I am hopeless at times... I have to know the details... :rolleyes: )

08-09-2005, 10:43 AM
Please Read all
XHTML 1.0 STRICT (http://www.google.com/custom?q=xhtml+1.0+strict&cof=T%3Ablack%3BLW%3A72%3BALC%3A%23ff3300%3BL%3Ahttp%3A%2F%2Fwww.w3.org%2FIcons%2Fw3c_home%3BLC%3A%2 3000099%3BLH%3A48%3BBGC%3Awhite%3BAH%3Aleft%3BVLC%3A%23660066%3BGL%3A0%3BAWFID%3A0b9847e42caf283e%3B&sitesearch=www.w3.org&domains=www.w3.org)

08-09-2005, 11:03 AM
Don't put in that xml prolog. It throws IE into quirks mode wich you don't want.

Bill Posters
08-09-2005, 01:01 PM
Please Read all
XHTML 1.0 STRICT (http://www.google.com/custom?q=xhtml+1.0+strict&cof=T%3Ablack%3BLW%3A72%3BALC%3A%23ff3300%3BL%3Ahttp%3A%2F%2Fwww.w3.org%2FIcons%2Fw3c_home%3BLC%3A%2 3000099%3BLH%3A48%3BBGC%3Awhite%3BAH%3Aleft%3BVLC%3A%23660066%3BGL%3A0%3BAWFID%3A0b9847e42caf283e%3B&sitesearch=www.w3.org&domains=www.w3.org)

I can't think of a faster way to put people off of using xhtml that suggesting or expecting that they should read the raft of w3c documents on the subject.
I've never read any of those documents right through and only even looked at them after already familiarised myself with xhtml. They are painfully dry and not something I'd recommend to someone new to markup (of any variety).

For my money, the w3schools site is considerably better presented to help (normal) people develop an understanding of xhtml. Doggo18 has already stated that they have found some sources hard going, so I don't think the W3C site is going to be an improvement.

Fwiw, Sitepoint.com (http://www.sitepoint.com/subcat/html) is a well-maintained site with some articles that you may find worthwhile and easier to grasp.
e.g. http://www.sitepoint.com/article/xhtml-web-design-beginners-2/2

There are also a number of articles on issues that complement xhtml, such as accessibility and css-based layouts.

xhtml will be the hub of a range of good coding coding practices and you should take this opportunity to develop a good understanding (and hopely an appreciation for) 'semantic' markup.

Links worth checking out:
'xhtml' @ alistapart.com (http://search.atomz.com/search/?sp-q=xhtml&sp-a=sp1002d27b&sp-f=ISO-8859-1&sp-p=All&sp-k=All)


It's also worth knowing about the mime-type implications of using xhtml markup, but don't necessarily get yourself hog-tied by the concept of the all or nothing attitude, which some have…

The Hixie article is worth reading as it goes to some length to create a worst case scenario regarding the transitional from XHTML markup served as text/html to serving it as application/xhtml+xml, but don’t be swayed by it’s conclusion - namely that serving xhtml markup is harmful.
The technical aspects of the article are sound, but the editorial viewpoint is, imho, not only flawed and sensationalist, but counterproductive to general progress in web development.

Anyhoo, … www.hixie.ch/advocacy/xhtml

Yes, it's certainly worth knowing about these issues, but once you are aware, youll realise how simply it is to stay out of harm’s way if/when you complete the xhtml transitional by serving your markup with the ‘ideal’ mime-type.
Certainly don't let it put you off using methods which work with text/html in the meantime. Just be aware.
(Fwiw, it's not "harmful" to serve xhtml markup as text/html, but it is naive to assume that text/html-compatible methods will automatically work when serving the markup as application/xhtml+xml.)

You can bypass most of the concerns by getting to grips with w3c DOM-based javascript methods, though predictably, you may find support still lacking in some browsers, potentially forcing you to revert to methods which work in text/html but not application/xhtml+xml.

Incidentally, if using javascript, it's worth reading up on the notion of ‘unobtrusive javascript’, which in essence is the implementation of javascript in ways that suppliment and enhance a site’s basic accessibility and usability, i.e. not using it to deliver essential content or to provide the only means of navigation.
Here’s a worthy article: http://www.onlinetools.org/articles/unobtrusivejavascript/

You would do well to subscribe to the RSS feeds from a number of good sites which provide articles (and links to other articles) which will help you develop a basic understanding of xhtml and the surrounding issues as well as to help you to continue to develop your understanding and proficiency in its use.

Any of the following sites would be a good place to start…

Finally, here's a centralised page/resource containing links to some of the more useful online sites and resources that a progressive web developer is likely to appreciate.

hth :)

08-09-2005, 08:58 PM
mrruben5: That was very useful to know, thank you. Exactly one of the things I wanted to know.

Bill Posters:

I am already quite familliar with tableless layouts, and the proper usage of XHTML and CSS. It is just the more technical details that I am wondering about. Some of the links you posted were useful, others I had read a long long time ago already. In any case, I appreciate the huge post. The part about mime types is intruiging too, but it isn't what I was after.

So, basically what I gather so far:

Don't use the <?xml prolog.

How about the html tag?

<html xmlns="..." xml:lang="..." lang="...">

I am still confused as to the difference between xml:lang and lang, as well as the fact is they are required, and whether xmlns should or should not be included.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum