This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
For the URL http://www.livinglogic.de/Python/ the validator complains about a namespace declaration for the XML namespace. The XHTML file starts with: <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:xml="http://www.w3.org/XML/1998/namespace" lang="en" xml:lang="en"> IMHO this namespace declaration should be allowed.
If you check http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd you will find that an "xmlns:xml" attribute is not allowed for the <html> element. If you think this should be changed, you should read the Status section of the XHTML 1.0 Recommendation http://www.w3.org/TR/xhtml1/ and post a comment to the www-html-editor mailing list. If you can convince the HTML Working Group to change the document type definition we will upgrade the Validator to use the new document type definition instead.
Comment #1 cleverly avoids stating the original bugreport is invalid. :-) I get the same error when I have a 'xmlns="http://www.w3.org/1999/xhtml"' attribute on an nonroot-element in my document. The DTD only alows (and requires) it on the html element. But isn't the xmlns attribute part of the XML-specification. It is kind of part of the layer under XHTML? The XHTML recommendation states (in http://www.w3.org/TR/xhtml1/#well-formed) states that other namespaces MAY be used. But the document is then nolonger "strictly conforming". It does not state what the document then is. But in my case I am not using another namespace. And according to http://www.w3.org/TR/REC-xml-names/ the xmlns-attribute is valid on any element.
http://www.w3.org/TR/REC-xml-names does not state this, a document is valid or namespace-valid iff it meets the constraints of the markup declarations, if you do not have a ATTLIST declaration for the xmlns attribute or the xmlns:xml attribute on the relevant elements, then the document is not valid; the XHTML 1.0 DTDs don't do this, so for "XML validity" of "XHTML 1.0 documents" this is not allowed. You might disagree with these design decisions of the HTML Working Group, in this case you should raise your concern on www-html-editor@w3.org, the Validator just checks whether documents meet the constraints, we don't make them.
The XHTML validator currently complains about the html tag in a document beginning: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"> According to http://www.w3.org/TR/2006/REC-xml-names-20060816 Section 2.1, "An attribute-based declaration syntax is provided to bind prefixes to namespace names and to bind a default namespace that applies to unprefixed element names; these declarations are scoped by the elements on which they appear so that different bindings may apply in different parts of a document. Processors conforming to this specification MUST recognize and act on these declarations and prefixes." This sounds to me (as claimed before by someone else in Comment #2) like the XML Namespaces rec is saying that xmnls and xmlns-prefixed attributes do not need to be included in any ATTLIST of the DTD in order to be valid; they must be recognized. An attribute-based syntax is used, but these are not standard attributes. Think of it this way: if a DTD had an ATTLIST containing the single attribute xmlns:hmm, would that mean that I could include a namespace declaration such as xmnls:hmm="http://www.example.org" but I couldn't use a namespace declaration such as xmlns:duh="http://www.example.com"? Of course not: surely in any document conforming with XML Namespaces I should be able to choose any namespace prefix I want (as long as it isn't reserved). So xmlns:duh must also be a valid attribute. This means that xmlns-prefixed attribute specifications cannot be treated the same way for validation purposes as are normal attributes by looking for them in a DTD. And in light of the quote above, I think that it's clear that xmlns and xmlns-prefixed attributes must be considered valid on every tag in every document conforming with XML Namespaces. So I believe that it is wrong for the XHTML validator to complain about the html tag above as well as about the original markup in the original bug report and that in Comment #2. I don't think that this is a problem with the XHTML/XML/XML Namespaces recommendations, but with how the validator is implementing them.
Created attachment 466 [details] Patch to implement ignoring xmlns: attribute declaration errors Actually, since XHTML family document types adhere to the XML and XML Namespace recommendations, Comment #4 is correct - any xmlns:whatever attribute should be permitted on any element. Unfortunately, this is somewhat challenging to implement in validation engine that we have available. I have a patch for "check" that permits it to ignore errors of this type against the 0.8.0 beta. I will attach it here.
Created attachment 467 [details] Updated against version 1.507
Created attachment 468 [details] Amended Patch, using XML mode as trigger, matching error number rather than text Shane, thanks a lot, your patch looks like a good solution. I am attaching a patch with a couple proposed modifications: * use $File->{Mode} eq 'XML' as trigger rather than an option always set to TRUE, so that usage of xmlns prefix in SGML/HTML mode trigger (correct) errors * match the internal opensp error message code for the attribute, rather than the text of the error message - which should hopefully be a little more robust (opensp is localized in a few languages, so the error message text could be different)
Patch commited to CVS.