[XML-SIG] minidom parse error - keyerror
uche.ogbuji at fourthought.com
Sun Sep 12 06:49:21 CEST 2004
On Fri, 2004-09-10 at 04:51, Ajay wrote:
> Quoting Uche Ogbuji <uche.ogbuji at fourthought.com>:
> > On Wed, 2004-09-08 at 22:34, Ajay wrote:
> > > hi!
> > >
> > >
> > > Quoting Alan Kennedy <alanmk at hotmail.com>:
> > >
> > > > [Ajay]
> > > > > 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.
> > > >
> > > > and
> > > >
> > > > >>i am parsing the attached document.
> > > > >>the code is
> > > > >>parser = make_parser('xml.sax.drivers2.drv_xmlproc')
> > > > >>ruleSet = parse(ruleSetFile, parser=parser)
> > You've got some odd code here. The following works for me (no errors):
> > >>> from xml.sax import make_parser
> > >>> parser = make_parser('xml.sax.drivers2.drv_xmlproc')
> > >>> ruleSet = parser.parse("foo.xml")
> > Where "foo.xml" is the file I pasted in from your message.
> i should have put my import statements. i am actually trying to use minidom
> with xmlproc. thus the code really is
> from xml.dom.minidom import parse
> from xml.sax import make_parser
> ruleSet = parse('foo.xml', parser=parser)
> this throws the error i described earlier for the document which i also
> posted earlier.
> so what am i doing wrong?
I don't think you're doing anything especially wrong. This looks like a
bug in pulldom. Seems as though it can't handle "global" attributes
when fed from parsers that don't report namespace prefix mappings.
breaks in this case.
This will probably require some work in PullDOM to address :-(
Man, you seem to have the worst luck here.
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Meet me at XMLOpen Sept 21-23 2004, Cambridge, UK. http://xmlopen.org
A hands-on introduction to ISO Schematron - http://www-106.ibm.com/developerworks/edu/x-dw-xschematron-i.html
Wrestling HTML (using Python) - http://www.xml.com/pub/a/2004/09/08/pyxml.html
XML circles the globe - http://www.javareport.com/article.asp?id=9797
Element structures for names and addresses - http://www.ibm.com/developerworks/xml/library/x-elemdes.html
Commentary on "Objects. Encapsulation. XML?" - http://www.adtmag.com/article.asp?id=9090
Harold's Effective XML - http://www.ibm.com/developerworks/xml/library/x-think25.html
A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/
More information about the XML-SIG