jythonc and xml parser

TimC tim at nowhere.com
Tue Jan 21 10:52:25 CET 2003


Ype Kingma wrote:
> 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
> 

thanks Ype,
unfortunately, my last post was much shorter than intended (frustration 
at 2 yr old mozilla bug). I have imported the driver directly, but that 
then bombs out on some unicode stuff in characters.py. I was wondering 
if anyone had got the set of magic imports that makes this work - I got 
fed up with tracing it back by hand. (I don't know the environment too 
well.)

Tim





More information about the Python-list mailing list