[XML-SIG] pb with sax2 and name spaces

Sylvain Thenault Sylvain.Thenault@logilab.fr
Mon, 29 Oct 2001 17:25:19 +0100 (CET)


Hello!

I'm trying to write a sax2 handler, but when I want to parse an xml file
using :

    from xml.sax import make_parser
    from xml.sax.handler import feature_external_ges 
    p = make_parser(["xml.sax.drivers2.drv_xmlproc"])
    p.setFeature(feature_namespaces, 1)
    p.setFeature(feature_validation, 0)
    p.setFeature(feature_external_ges,1)
    p.setContentHandler(handler)
    p.parse(f)

Everything is ok while there are no namespaces in the parsed
document or while the namespaces feature is disabled. On the first 
namespace (with the namespaces feature), I just obtain the following
error:

Traceback (most recent call last):
  File "parser.py", line 174, in ?
    p.parse(f)
  File
"/home/syt//lib/python2.1/site-packages/_xmlplus/sax/drivers2/drv_xmlproc.py",
line 90, in parse
    parser.read_from(source.getByteStream(), bufsize)
  File
"/home/syt//lib/python2.1/site-packages/_xmlplus/parsers/xmlproc/xmlutils.py",
line 137, in read_from
    self.feed(buf)
  File
"/home/syt//lib/python2.1/site-packages/_xmlplus/parsers/xmlproc/xmlutils.py",
line 185, in feed
    self.do_parse()
  File
"/home/syt//lib/python2.1/site-packages/_xmlplus/parsers/xmlproc/xmlproc.py",
line 96, in do_parse
    self.parse_start_tag()
  File
"/home/syt//lib/python2.1/site-packages/_xmlplus/parsers/xmlproc/xmlproc.py",
line 187, in parse_start_tag
    self.app.handle_start_tag(name,attrs)
  File
"/home/syt//lib/python2.1/site-packages/_xmlplus/sax/drivers2/drv_xmlproc.py",
line 336, in handle_start_tag
    AttributesNSImpl(attrs, rawnames))
  File "parser.py", line 64, in startElementNS
    self._handler.startElementNS(name, qname, attrs)
  File "/home/syt/lib/python2.1/site-packages/Ft/Xml/pDomletteReader.py",
line 238, in startElementNS
    (foo,bar, baz) = self._handleStartElementNss(name, attribs)
  File "/home/syt/lib/python2.1/site-packages/Ft/Xml/ReaderBase.py", line
225, in _handleStartElementNss
    raise "Namespaces in validating docs not supported"
Namespaces in validating docs not supported    

(notice I have disabled validation !)

Anybody has an idea ?

TIA

-- 
Sylvain Thenault

LOGILAB