[XML-SIG] [ pyxml-Bugs-738366 ] Unneccessary comments from external DTD

SourceForge.net noreply@sourceforge.net
Thu, 15 May 2003 09:23:54 -0700


Bugs item #738366, was opened at 2003-05-15 18:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=738366&group_id=6473

Category: DOM
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jacek Konieczny (jajcus)
Assigned to: Nobody/Anonymous (nobody)
Summary: Unneccessary comments from external DTD

Initial Comment:
When reading document that uses external DTD with
xml.dom.ext.reader.Sax2.Reader and then writting it
with xml.dom.ext.Print or PrettyPrint the output
includes unneccessary comments from the DTD.

Here is a sample of code:
-- cut ---
from xml.dom import implementation
from xml.dom import DOMException
from xml.dom.ext.reader.Sax2 import Reader
from xml.dom.ext import PrettyPrint

import cStringIO

doc_str="""
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en"/>
"""

reader=Reader()
doc=reader.fromStream(cStringIO.StringIO(doc_str))
PrettyPrint(doc)
-- cut ---

And here is a fragment of its output:
-- cut ---
<?xml version='1.0' encoding='UTF-8'?>                
                         
<!DOCTYPE html PUBLIC
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" "-//W3
C//DTD XHTML 1.0 Strict//EN">
<html xmlns='http://www.w3.org/1999/xhtml'
xml:lang='en' lang='en'/>
<!--
   Extensible HTML version 1.0 Strict DTD             
                        
              
   This is the same as HTML 4 Strict except for       
                        
   changes due to the differences between XML and SGML.
-- cut ---


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=738366&group_id=6473