[XML-SIG] speed question re DOM parsing

Bjorn Pettersen bjorn@roguewave.com
Wed, 24 May 2000 10:11:30 -0600


I'm just starting to work with XML, so be gentle <wink>

The problem is that I'm reading in a 280K xml file using the sample code
from the XML howto:

def getXmlDomDocument(name):
        p = saxexts.make_parser()
        dh = SaxBuilder()
        p.setDocumentHandler(dh)
        p.parseFile(open(name))
        p.close()
        doc = dh.document
        xml.dom.utils.strip_whitespace(doc)
        return doc

it takes about five seconds to read and parse the file...

Is there a better way to read the file (or is there updated code that is
faster)?

-- bjorn