jythonc and xml parser

Ype Kingma ykingma at accessforall.nl
Tue Jan 21 02:53:12 EST 2003


Tim wrote:

> Hullo
> Has anyone managed to get an xml parser to work with jythonc?
> the simple program:
> from xml.sax import make_parser
> 
> parser = make_parser()
> 
> works in jython (but doesn't do much ;-) ). However, when built with:
> jythonc -c --jar a.jar <filename>
> and then run, it cannot find a parser (SAXReaderNotAvailable: No parsers
> found).

I don't know about xml.sax, but when the parsers are not loaded
by name, but eg. by using __import__() jythonc cannot know the
name of the parser module, so it cannot include it in it's output.
When that is the case, the solution is to import the module
explicitly somewhere in your program, so jythonc knows that it
should be included.
In your case, that would mean explicitly importing any parser
that your program my need.

Regards,
Ype

-- 
email at xs4all.nl




More information about the Python-list mailing list