Re: Validator and XML namespaces

At 2002-10-04T21:04-0400, Miles Elam wrote:-

> Reference URL: http://geekspeak.corkdog.com/shouldvalidate.html
>
> Shows erroneous errors about namespace declaration -- "xmlns is not a
> valid attribute".

There are two problems here.

The first is that namespaces are in no way special for validation. The
xmlns:* attributes (and the elements and attributes in those namespaces)
are not in the XHTML 1.0 DTDs, so you can't use them in a valid XHTML 1.0
document. If you want to use other namespaces you will need a DTD that
includes the required elements and attributes. (This is slightly more
practical with XHTML 1.1 and up, using modularisation. DTDs have been
created for using XHTML with MathML and SVG.)

The second is that the validator is not really complaining about the xmlns
attribute (which does exist in XHTML 1.0), but about the xmlns:*
attributes. It is having trouble parsing the output of the SGML parser it
uses, which so helpfully delimits fields using ':'...


Tim Bagot

Received on Saturday, 5 October 2002 05:39:50 UTC