[Bug 3663] If SVG content-type detected, sniff doctypeless SVG documents for version and profile.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3663

           Summary: If SVG content-type detected, sniff doctypeless SVG
                    documents for version and profile.
           Product: Validator
           Version: 0.7.2
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: check
        AssignedTo: ot@w3.org
        ReportedBy: ot@w3.org
         QAContact: www-validator-cvs@w3.org


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.

Received on Thursday, 7 September 2006 01:27:45 UTC