<?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>7073</bug_id>
          
          <creation_ts>2009-07-01 18:24:23 +0000</creation_ts>
          <short_desc>Changing document type works incorrectly when document has internal subset</short_desc>
          <delta_ts>2009-12-14 18:31:09 +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>Parser</component>
          <version>HEAD</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>major</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</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>25841</commentid>
    <comment_count>0</comment_count>
    <who name="">major</who>
    <bug_when>2009-07-01 18:24:23 +0000</bug_when>
    <thetext>When I select some document type in &apos;More options&apos; menu and the document already contains &lt;!DOCTYPE&gt;, the validator should enclose full &lt;!DOCTYPE&gt; into &lt;!-- comment --&gt; and add new &lt;!DOCTYPE&gt; declaration. It doesn&apos;t work fine, when I try to validate document with an internal subset:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot; [
	&lt;!ENTITY foo &quot;bar&quot;&gt;
]&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
	&lt;title/&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;p&gt;&amp;foo;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

After selecting XHTML 1.0 Strict Document type in More Options menu and checking Show source, I have expected Valid XHTML 1.0 Strict and following code displayed:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;!-- &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot; [
	&lt;!ENTITY foo &quot;bar&quot;&gt;
]&gt; --&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
	&lt;title/&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;p&gt;&amp;foo;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

But I have had got 4 Errors, 2 warning(s) and following code:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;&lt;!-- &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot; [
	&lt;!ENTITY foo &quot;bar&quot;&gt; --&gt;
]&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
	&lt;title/&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;p&gt;&amp;foo;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30126</commentid>
    <comment_count>1</comment_count>
    <who name="Ville Skyttä">ville.skytta</who>
    <bug_when>2009-12-14 18:31:09 +0000</bug_when>
    <thetext>Doctype override is currently implemented using HTML::Parser, which unfortunately has problems in scenarios such as this one.

http://search.cpan.org/dist/HTML-Parser/Parser.pm#declaration</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>