[XML-SIG] Using PyExpat.py

Uche Ogbuji uche.ogbuji@fourthought.com
Sat, 10 Feb 2001 14:07:40 -0700


> I'll try installing 0.6.3 and hammer on it for awhile. Note that I'm
> able to build a DOM using the lines:
> 
>    from xml.dom import ext
>    from xml.dom.ext.reader import Sax2
>       :
>       :
>    xml_dom_object = Sax2.FromXmlFile(filename, validate=0)
> 
> I'm just hoping to build a DOM with expat to improve performance. Thanks
> for any suggestions.

I do recommend the upgrade, and 0.6.4 is on its way.

As a forewarning, the 0.6.3 and up way is

from xml.dom.ext.reader import PyExpat     #or Sax2
reader = PyExpat.Reader()
xml_dom_object = reader.fromUri(filename)  #should work for either URL or file

Good luck.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python