Exception in multiple use of xml.dom.minidom.parse()

Martin Lüthi answer at tnoo.net
Fri Mar 21 17:31:48 EST 2003


Dear Pythonistas

An exception is trown when I try to parse a several xml files. For the first file
everything works out as described in the docs (for Python 2.2), using

Python 2.2.2 (#1, Oct 17 2002, 08:48:02) 
[GCC 2.95.3 20010315 (SuSE)] on linux2

python-docs-2.2p1/lib/module-xml.dom.minidom.html

>>> from xml.dom.minidom import parse

>>> dom1 = parse('/my/data1.xml') # parse an XML file by name

When I try to access an other file

>>> dom2 = parse('/my/data2.xml') 

I get the following exception

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/dom/minidom.py", line 962, in parse
    return _doparse(pulldom.parse, args, kwargs)
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/dom/minidom.py", line 953, in _doparse
    events = apply(func, args, kwargs)
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/dom/pulldom.py", line 338, in parse
    parser = xml.sax.make_parser()
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/sax/sax2exts.py", line 37, in make_parser
    return XMLParserFactory.make_parser(parser_list)
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/sax/saxexts.py", line 64, in make_parser
    return self._create_parser(parser_name)
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/sax/saxexts.py", line 43, in _create_parser
    return drv_module.create_parser()
  File "/usr/local/lib/python2.2/site-packages/_xmlplus/sax/saxexts.py", line 74, in _create_parser
    raise _exceptions.SAXReaderNotAvailable
TypeError: __init__() takes at least 2 arguments (1 given)

Is this the expected behaviour?

Thanks

Martin

-- 
Martin Lüthi                 answer at tnoo.net





More information about the Python-list mailing list