This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I'm puzzled that, when checking the (correct) document <svg xmlns="http://www.w3.org/2000/svg"/> the beta validator tells me that a) its invalid (its not); b) that I should add an HTML 4 transitional doctype and that until I do, my document will be invalid (not true) and c) that there is an xml namespace declaration in a non-xml document (it is an xml document)
If your document does not declare its document type, just use the "Use Doctype" option and it will validate just fine. Otherwise, especially in the case of direct input, the validator does not know 1) the document type 2) the media type (hence falling back to sgml mode because it does not know the document type either)
Changing Summary From: well formedness, validity, xmlns and 'not HTML' To: Auto-Detect fallback document type based on root element and setting to a someday milestone, as this may not be trivial enough for immediate fix.
Thanks for the summary change, Olivier. It covers most of my point and is clearer. The remaining thing is that the validator says that a document is not valid. Rather, it should say that it does not know if its valid. Reviewing the possible sources of machine-readable validity information: a) A DTD may be supplied, and may or may not be intended to completely describe a document (it may for example just declare some entities in the internal DTD subset) b) A W3C XML Schema may be supplied (but providing a link to one with xsi:schemaLocation is optional) c) A RelaxNG schema, with or without Schematron annotation may be there. General practice is not to explicitly link to it from the instance. Thus, when presented with a document, the validator should exercise caution when declaring that something is invalid. Sometimes it is invalid, sometimes its valid ,and sometimes the validator does not have enough information to tell (or does not support the schema language used). I would like the validator to explicitly use this third case where appropriate, rather than giving a false negative.
Also, what causes the "there is an xml namespace declaration in a non-xml document"? I tried adding the (optional) xml declaration, but got the same error.
Fo lack of information the Validator is using its default mode which is SGML and then warning you that you're using an XML feature in a non-XML document instance. IOW, it's kind of a cascading error.
Let's see if this can be dealt with for 0.8.0...
Some recent improvements to the handling of XML documents have made this case less acute: e.g http://qa-dev.w3.org/wmvs/HEAD/check?uri=http://qa-dev.w3.org/wmvs/HEAD/dev/tests/4476-svg_nodoctype.svg;ss The example: http://qa-dev.w3.org/wmvs/HEAD/dev/tests/4476-svg_nodoctype.svg;ss * is served with an XML mime type * does not have an <html> root element => and is therefore marked as being well-formed XML The idea of falling back to an SVG doctype based on svg root element still stands. Note that in the case of direct input, sending something like: <svg xmlns="http://www.w3.org/2000/svg"/> the validator will remain confused, for lack of a good way (i.e mediat type) to know if the document is XML.
I looked at this in the past few days, and the way to make this work would probably be too disruptive to be done safely at such a stage (beta test), so I would rather play safe and do it later. Moving target milestone.
For a future "can't tell" validation result i propose a favicon that has: - the top left half red - the bottom right half green - a black question mark on top Same for the colored bar in the result page