This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
SVG documents are often omitting DOCTYPE declaration (for the sake of brevity, IIRC). This is an obvious problem for validation, as it relies upon DOCTYPE declaration for the selection of the proper doctype to validate the document against. Recent progress has been made to add SVG document types to the doctype drop-down, allowing forced validation of SVG documents without doctype declarations. See e.g: http://dev.w3.org/cvsweb/validator/share/templates/en_US/popup_doctype.tmpl.diff?r1=1.5&r2=1.6&f=h (targeted for 0.7.3 release) There is an additional change that could make things more usable for users of SVG. As discussed in Bug #1500 and Bug #24, we are currently reworking some of the tools's mechanisms with regards to content-type handling. Current mechanism is: * check content-type * preparse document to find a doctype * send document to opensp, which will fallback to a default doctype if no doctype found Proposed mechanism: * check content-type * preparse document to find a doctype * if no doctype found, and content type is image/xml+svg, look for an <svg> element and its profile and version attributes * if these are found, add the relevant doctype to the document and pass it to the parser This will allow at least "tentative validation" of the document according to the "sniffed" document type.
The proposed solution would be suitable for SVG 1.0, and 1.1 Tiny, Basic and Full. it would not be suitable for SVG 1.2, or for compound documents such as CDI or XHTML+math+SVG. For those cases,namespace awareness is needed and DTDs are either suboptimal or clearly inappropriate.
With Bug 857 fixed, we can now more easily add a doctype on the fly even for documents with xml declaration. preparse_doctype routine already looks at root element and some other attributes (e.g xmlns), we can make it look for version and baseProfile too, and add mechanism to add doctype if those are found in convincing way.
test cases added: http://lists.w3.org/Archives/Public/www-validator-cvs/2007Oct/0013.html Targeting resolution for 0.8.2
Patch made and applied to CVS: http://lists.w3.org/Archives/Public/www-validator-cvs/2007Oct/0020.html The code seems to be working for all the test cases present: http://qa-dev.w3.org/wmvs/HEAD/dev/tests/#valid_doctypeless (need a tad more testing on other kinds of doctypeless docs before declaring victory)
Closing this, while being well aware that this is only a solution for svg documents with no foreign namespace elements, etc.