XML: SAX and XInclude

Laurent Pointal laurent.pointal at limsi.fr
Mon Sep 10 09:23:23 EDT 2007


[python 2.5, Linux Mandriva 2007.1]

Hello,

does anybody know about an XML parser usable with the sax API (xml.sax) 
and with XInclude feature support (directly or via hacks).

With specifying nothing (default parser), it simply transmit xinclude 
elements (i tried to call parser on included file but it seem to be 
waiting for a complete document with root element).

I tried libxml2, but failed with error (cf at the end).

I tried xmlproc, but it simply transmit xinclude elements too.

Thanks (its for PQRC - I've a first xhtml production which is not bad, 
when it'll be ok I will work on OpenDocument XML production - and  would 
like to split PQRC xml source into several files).


A+

Laurent.



Problem with libxml2:
[laurent at litchi qrccompiler]$ python compiler.py
processing
Traceback (most recent call last):
   File "compiler.py", line 573, in <module>
     sys.exit(main(*sys.argv[1:]))
   File "compiler.py", line 569, in main
     handler.process_source()
   File "compiler.py", line 465, in process_source
     self.saxparser = make_parser(["libxml2"])
   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/sax2exts.py", 
line 37,
in make_parser
     return XMLParserFactory.make_parser(parser_list)
   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/saxexts.py", line 64,
in make_parser
     return self._create_parser(parser_name)
   File "/usr/lib/python2.5/site-packages/_xmlplus/sax/saxexts.py", line 43,
in _create_parser
     return drv_module.create_parser()
AttributeError: 'module' object has no attribute 'create_parser'




More information about the Python-list mailing list