[XML-SIG] minidom parse error - keyerror

Ajay abra9823 at mail.usyd.edu.au
Wed Sep 8 01:03:04 EDT 2004


hi!

i have tried the archives now and heaps of Google searches but am no closer
to finding out what the error is.

the error does not appear if i use expat.

cheers


Quoting Ajay <abra9823 at mail.usyd.edu.au>:

> hi!
>
> i am parsing the attached document.
> the code is
> 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.
>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list