On Mon, 20 Aug 2007, pamela fluente wrote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
These pages are very recent and generated by VS 2005 (most modern tool
for asp.net pages), so I guess Microsoft used that doctype to ensure
some compatibility (?).
Compatible with what?
XHTML is only partially compatible with HTML, and XHTML 1.0 will not be a
subset of later versions of XHTML.
For the brand new pages (containing HTML/CSS and Javascript only) I am
going to create, what is the most wise and competent choice for the
DOCTYPE.
There are long discussions and a long controversy about this topic. I am
not an expert -- so my perception of this controversy is skewed by
ignorance. Here is what a dummy like me believes to have understood:
XHTML is not HTML, only XHTML 1.0 has the same set of tags as HTML 4.0 in a
slightly different syntax. So the answer is: use a doctype XHTML if it is
XHTML and served as such, and use a doctype HTML if it is HTML and served as
such. Serving XHTML as HTML is not recommended (see
http://www.hixie.ch/advocacy/xhtml).
The syntax differences between XHTML 1.0 and HTML 4.0 are small enough that
one can try to comply with both at the same time. (The most important
exception are the "/>" tag delimiters, but it is hardly conceivable that
there will ever be browsers interpreting them the SGML way -- these would
break with most "tag soup" pages, and "tag soup" is de facto the only
feasible way to interpret HTML, given the mess of not standard-compliant Web
pages.)
Should I try to be as strict as possible? And in case why?
More important as strictness is honesty. If your page validates against the
strict DTD, call it strict. If it validates only against the transitional
DTD, call it transitional. If does not even validate against the
transitional DTD, fix it.
Yes, if you have the choice of ensuring that your page validates against the
strict DTD, do it.
--
Helmut Richter