[xml] python, libxml2, namespaces, and locator
- From: Morgen Sagen <morgen osafoundation org>
- To: xml gnome org
- Subject: [xml] python, libxml2, namespaces, and locator
- Date: Fri, 19 Dec 2003 16:05:13 -0800
Under Python, I tried using libxml2 via the libxml2.SAXParseFile( )
method, but it calls only my StartElement( ) callback rather than
StartElementNS( ). Then I discovered the drv_libxml2.py driver and got
that to work like so...
self.parser = xml.sax.make_parser(["drv_libxml2"])
self.parser.setFeature(xml.sax.handler.feature_namespaces, True)
self.parser.setFeature(xml.sax.handler.feature_namespace_prefixes,
True)
...except that it doesn't currently support setDocumentLocator.
Is there a way to enable the namespaces and namespace_prefixes features
while using SAXParseFile( ) (or createPushParser( ), or ... )?
Much appreciated,
~morgen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]