W3C home > Mailing lists > Public > www-html@w3.org > August 2002

Re: xhtml validation

From: Christian Wolfgang Hujer <Christian.Hujer@itcqis.com>
Date: Tue, 20 Aug 2002 19:46:08 +0200
To: "Brian V Bonini" <b-bonini@cox.net>, <www-html@w3.org>
Message-Id: <200208201946.08155.Christian.Hujer@itcqis.com>

On Tuesday 20 August 2002 15:00, Brian V Bonini wrote:
> Why do xhtml documents validate without the inclusion of
> xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" yet the specs
> state " The root element of the document must contain an xmlns declaration
> for the XHTML namespace [XMLNS]"?
Because your validator is validating via XML, so it retreives the external subset of the document type definition which includes a declaration of this namespace like:
<!ATTLIST html
	xmlns	CDATA	"http://www.w3.org/1999/xhtml" #FIXED
So semantically, if your document is valid XML, it *has* this declaration implicitely from the DTD.
It is just not physically present.

I myself also find the statement "The root element of the document must contain an xmlns declaration for the XHTML namespace [XMLNS]" [http://www.w3.org/TR/xhtml1/#strict] a bit misleading.
As far as I followed another thread, this statement shall mean that the root element must contain the xmlns declaration physically, so the namespace is known even if the document is not validated / the DTD or external subset not read.

But your validator does not check wether your document is valid XHTML conforming to the specification of XHTML, your validator is just checking wether your document is valid XML conforming to XML and DTD of XHTML, not the recommendation of XHTML.
This is a slight difference.

If you used the W3C Validator for validating your document, you might consider reporting this as a bug or feature request to the maintainers of the W3C Validator.
They have written their parser themselves in Perl and probably can add such a feature.

But, as far as I know, no validating XML parser will ever check wether the html element contains the xmlns-declaration in the document.

Christian Wolfgang Hujer
Geschäftsführender Gesellschafter
Telefon: +49 (089) 27 37 04 37
Telefax: +49 (089) 27 37 04 39
E-Mail: mailto:Christian.Hujer@itcqis.com
WWW: http://www.itcqis.com/
Received on Tuesday, 20 August 2002 13:46:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:00 UTC