[Bug 7073] New: Changing document type works incorrectly when document has internal subset

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

           Summary: Changing document type works incorrectly when document
                    has internal subset
           Product: Validator
           Version: HEAD
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Parser
        AssignedTo: dave.null@w3.org
        ReportedBy: major@minet.sk
         QAContact: www-validator-cvs@w3.org


When I select some document type in 'More options' menu and the document
already contains <!DOCTYPE>, the validator should enclose full <!DOCTYPE> into
<!-- comment --> and add new <!DOCTYPE> declaration. It doesn't work fine, when
I try to validate document with an internal subset:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [
        <!ENTITY foo "bar">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <title/>
</head>
<body>
        <p>&foo;</p>
</body>
</html>

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:

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

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

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


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 1 July 2009 18:24:39 UTC