<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3663</bug_id>
          
          <creation_ts>2006-09-07 01:27:38 +0000</creation_ts>
          <short_desc>If SVG content-type detected, sniff doctypeless SVG documents for version and profile.</short_desc>
          <delta_ts>2007-10-09 09:49:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Validator</product>
          <component>check</component>
          <version>0.7.2</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.8.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Olivier Thereaux">ot</reporter>
          <assigned_to name="Olivier Thereaux">ot</assigned_to>
          
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>11471</commentid>
    <comment_count>0</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2006-09-07 01:27:38 +0000</bug_when>
    <thetext>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&amp;r2=1.6&amp;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&apos;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 &lt;svg&gt; 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 &quot;tentative validation&quot; of the document according to the &quot;sniffed&quot; document type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11486</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Lilley">chris</who>
    <bug_when>2006-09-07 14:03:01 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17009</commentid>
    <comment_count>2</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-10-03 07:47:07 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17010</commentid>
    <comment_count>3</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-10-03 08:10:54 +0000</bug_when>
    <thetext>test cases added:
http://lists.w3.org/Archives/Public/www-validator-cvs/2007Oct/0013.html

Targeting resolution for 0.8.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17012</commentid>
    <comment_count>4</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-10-03 10:45:17 +0000</bug_when>
    <thetext>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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17091</commentid>
    <comment_count>5</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-10-09 09:49:57 +0000</bug_when>
    <thetext>Closing this, while being well aware that this is only a solution for svg documents with no foreign namespace elements, etc.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>