[Tutor] xml.dom.minidom key error

Ajay abra9823 at mail.usyd.edu.au
Wed Sep 8 02:41:02 CEST 2004


hi!

i am parsing the attached document.
the code is

from xml.sax import make_parser
from xml.dom.minidom import parse
parser = make_parser('xml.sax.drivers2.drv_xmlproc')
ruleSet = parse(ruleSetFile, parser=parser)

i am using python2.3.4 with PyXML version 0.8.1

i get the following error

Traceback (most recent call last):
  File "evaluator.py", line 59, in ?
    ea = ae.evaluate("complywitheudirective.xml", "policy-eg1.xml", 0)
  File "evaluator.py", line 22, in evaluate
    ruleSet = parse(ruleSetFile, parser=parser)
  File "C:\PYTHON23\Lib\site-packages\_xmlplus\dom\minidom.py", line 1912,
in pa
rse
    {'parser': parser, 'bufsize': bufsize})
  File "C:\PYTHON23\Lib\site-packages\_xmlplus\dom\minidom.py", line 1899,
in _d
o_pulldom_parse
    toktype, rootNode = events.getEvent()
  File "C:\PYTHON23\Lib\site-packages\_xmlplus\dom\pulldom.py", line 265,
in get
Event
    self.parser.feed(buf)
  File
"C:\PYTHON23\Lib\site-packages\_xmlplus\sax\drivers2\drv_xmlproc.py", lin
e 96, in feed
    self._parser.feed(data)
  File
"C:\PYTHON23\Lib\site-packages\_xmlplus\parsers\xmlproc\xmlutils.py", lin
e 332, in feed
    self.do_parse()
  File "C:\PYTHON23\Lib\site-packages\_xmlplus\parsers\xmlproc\xmlproc.py",
line
 93, in do_parse
    self.parse_start_tag()
  File "C:\PYTHON23\Lib\site-packages\_xmlplus\parsers\xmlproc\xmlproc.py",
line
 197, in parse_start_tag
    self.app.handle_start_tag(name,attrs)
  File
"C:\PYTHON23\Lib\site-packages\_xmlplus\sax\drivers2\drv_xmlproc.py", lin
e 368, in handle_start_tag
    AttributesNSImpl(attrs, rawnames))
  File "C:\PYTHON23\Lib\site-packages\_xmlplus\dom\pulldom.py", line 98, in
star
tElementNS
    prefix = self._current_context[a_uri]
KeyError: u'http://www.w3.org/2001/02/appelv1'


any ideas why?

thanks
cheers







----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: complywitheudirective.xml
Type: text/xml
Size: 2973 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20040908/c9812b28/complywitheudirective-0001.xml


More information about the Tutor mailing list