[XML-SIG] Using PyExpat.py

Don Wakefield don_wakefield@mentorg.com
Sun, 11 Feb 2001 10:35:58 -0800 (PST)


>>>>> "Uche" == Uche Ogbuji <uche.ogbuji@fourthought.com> writes:

Uche> [Tale of woes snipped]

Uche> [...] I'd suggest either using

Uche> python setup.py install -f

Uche> To force file overwrites or just blow away the _xmlplus directory in your 
Uche> Python library and reinstall.

Here's an interesting discrepancy. I don't *have* an _xmlplus directory
in my Python library. I instead have, starting from PYTHONHOME:
lib/python1.5/site-packages/xml. When I installed PyXML-0.6.3, I mv'ed
xml away, and sure enough, 'python setup.py install --prefix=$MYDIR' put
a new xml directory there, not _xmlplus.

Just for chuckles, I tried it your way, and still only got an xml
directory. Running your test case with test.xml, I get the following
after the '-f' install:

  <37 : /user/donw/src/Demo/bigproto> python
  Python 1.5.2 (#1, Feb 10 2001, 16:25:02)  [GCC 2.9-mentor-98r2p24] on sunos5
  Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
  >>> from xml.dom.ext.reader import PyExpat
  >>> from xml.dom.ext import Print
  >>> reader = PyExpat.Reader()
  >>> xml_dom_object = reader.fromUri('test.xml') 
  Traceback (innermost last):
    File "<stdin>", line 1, in ?
    File "/user/donw/src/local/ss5/obj/lib/python1.5/site-packages/xml/dom/ext/reader/PyExpat.py", line 76, in fromUri
      if os.path.exists(uri):
  NameError: os
  >>> ^D

So I'm seeing the same cascade of problems... At least, PyExpat.py
doesn't look any different from my last try at an install...

I'll work on this more during the week. I'm beginning to think that I'm
missing stuff anyway. Does PyXML require anything in the Python
environment other than what comes by default? For instance, PyExpat.py
has the following line (fragment qyoted):

   raise Ft.Lib.FtException(Ft.Lib.Error.XML_PARSE_ERROR...

But to the best of my knowledge, I don't have any Ft module anywhere in
my Python install... Could this be part of the problem?

Uche> Note that if your need is for speed and your pattern is just parse and read, 
Uche> you might want to consider cDomlette (in 4Suite only) which is *very* fast, 
Uche> but read-only:

Thanks. Some of my usages will be read-only, so I'll try this out
(probably on Monday, since Sundays are busy and I'm fighting a cold ;^)~ ).

Uche> Not even close.  Your messages are *right* on-topic, and highly appreciated.  
Uche> We love to hear all the field-testing reports we can.

Thanks for the encouragement!

-- 
Don Wakefield                              Mentor Graphics Corporation
(503) 685-1262                             8005 S.W. Boeckman Road    
don_wakefield@mentorg.com                  Wilsonville, OR 97070-7777