[XML-SIG] problem processing XML files

Berthold Hoellmann hoel@germanlloyd.org
Mon, 30 Aug 1999 12:47:52 +0200


Hello,

I just downloaded and installed "xml-0.5.1.tgz". I want to process the
ScientificPython documentation using this. My first test was a file like

--- snip ---
import sys
from xml.dom.utils import FileReader

class DomDumper(FileReader):
    def __init__(self,filename):
        FileReader.__init__(self,filename)
        print self.document
        print self.getFileType(filename)
        self.document.dump()

d = DomDumper(sys.argv[1])
print d
--- snip ---

Calling this with "ScientificPython.xml" as argument only returns

>python dumper.py ScientificPython.xml 
<DOM Document; root=None >
XML
<DOM Document; root=None >
<__main__.DomDumper instance at bbc00>

but not the XML structure as expected. Does the parser silently ignore
syntax errors? Running

>python dumper.py sample.xml

with "sample.xml" copied from the "xml-0.5.1/demo/quotes" directory
gives the expected result. How do I check the files syntax using python?

Thanks

Berthold
-- 
email: hoel@GermanLloyd.org
   )
  (
C[_]  These opinions might be mine, but never those of my employer.