From: Sean M. <sea...@pr...> - 2005-10-17 08:26:11
|
Matt, I do a lot of XML work with Jython and find that re-using from the pool of excellent Java-based tools for XML parsing is a very powerful and simple way to go. I use Xerces and Xalan giving me very high levels of standards compliance with full XPath 1.0 implementation etc. In CPython some of the more comprehensive XML packages use C extensions for things like James Clark's expat, XPath grammers and so on. It is primarily these C/C++ extensions that cause problems making XML tools in CPython/Jython seamless. Sean [Matt Williams] >I've come up against a real problem with parsing XML in jython. I wrote >some code in python, but I cannot get it to run under Jython: >from xml.dom.ext.reader import Sax2 fails as Jython won't handle the >_xmlplus package >doc = minidom.parse(sourceDocument).documentElement fails as it can't >import the expatbuilder module (even though it's in the folder!) >Even: >from xml import sax >sax.parse(document) fails as it says it needs another argument. >Please could someone explain how I've managed to get myself into such as >mess! |