[XML-SIG] any one help me please

adw27@cam.ac.uk adw27@cam.ac.uk
Wed, 12 Sep 2001 10:02:02 +0100


--On 12 September 2001 15:25 +0800 =D7=A3=CB=B3=C3=F1 <zhusm@neusoft.com> =
wrote:

>
>
> help me please ,why can't parse the xml on linux.
> my os is slcakware -linux-7.0
> but the below programme have been executed on the windows 2000.

[program 1]

>>>> dom =3D xml.dom.minidom.parseString(document)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.0/xml/dom/minidom.py", line 475, in parseString
>     return _doparse(pulldom.parseString, args, kwargs)
>   File "/usr/lib/python2.0/xml/dom/minidom.py", line 464, in _doparse
>     events =3D apply(func, args, kwargs)
>   File "/usr/lib/python2.0/xml/dom/pulldom.py", line 237, in parseString
>     parser =3D xml.sax.make_parser()
>   File "/usr/lib/python2.0/xml/sax/__init__.py", line 76, in make_parser
>     return _create_parser(parser_name)
>   File "/usr/lib/python2.0/xml/sax/__init__.py", line 101, in
> _create_parser     return drv_module.create_parser()
> AttributeError: create_parser
>>>>

[program 2]
...
>>>> handleSlideshow(dom)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: There is no variable named 'dom'


It appears that the XML libraries have been omitted (or are not built by =
default) in the Python 2.1.1 source tarball. (They appear to be bundled =
with the Windows installer. I also had this problem.

Installing PyXML from http://pyxml.sf.net fixed this for me; I have no idea =

whether the XML libraries have been omitted by accident or design in the =
2.1.1 Unix release.

Andrew