Alex Bell wrote:
Quote:
The Doctype on almost all my webpages is
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
and I know that in the past this has validated without problem. |
A document type declaration as such cannot validate. It specifies the
definition according to which validation shall be performed.
Validation is about markup and not a stylesheet issue at all as such. In
practice the use of a document type declaration may have a huge impact on
rendering, including the effects of CSS rules, but this choice of "quirks"
vs. "standards" mode is based on the doctype declaration as a string (and on
the presence of anything before it).
Using XHTML instead of HTML 4.01 has no tangible benefits unless you use
XML-based tools. On the other hand, if you have already learned to cope with
XHTML oddities, there's no particular reason to move to HTML 4.01.
Quote:
Recently though I checked a page against the W3C validation service
and got an error message that
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
was missing. |
Not quite. It says:
"Missing xmlns attribute for element html. The value should be:
http://www.w3.org/1999/xhtml
[...]
Many Document Types based on XML need a mandatory xmlns="" on the root
element. For example, the root element for XHTML will look like:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">"
This is not much better, though - it is anglocentric bogosity that tells
people to declare their document content to be English, no matter what it
actually is. This is one of the reasons why search engines don't trust the
xml:lang and lang attributes.
The validity point, however, is just that the xmlns attribute is required by
the syntax, so when using an XHTML doctype you need to have
xmlns="http://www.w3.org/1999/xhtml" in the <html> tag. The xml:lang and
lang attributes have nothing to do with the validation issue.
I don't remember any change in the W3C validator in this respect.
Quote:
So I copied and pasted that into the page I wanted
checked, (as well as the original doctype) and tried again. But this
time I got 5 validation errors! |
You probably have markup errors in your document. To get more specific help,
post a more specific question. Hint: URL.
Quote:
Better still, could someone please copy their working doctype? Then
I'll copy and paste it into my page. |
Wrong approach. You need to select the document type declaration according
to the version of HTML you are using.
I copied the one I use now from
Quote:
Elizabeth Castro's 'HTML, XHTML, and CSS' and there is no mention of
the <html xmlns= and so on. |
--
--
Yucca, http://www.cs.tut.fi/~jkorpela/