From: Graham Klyne <gk-jython-users@ni...> - 2005-10-31 12:16:34
I'm developing some XML-using code in CPython 2.4, with a view to future
porting to a Jython environment under Tomcat or similar.
I spent a couple of hours the other day digging around for information
about a Jython-compatible subset of PyXml with maximum available DOM and
XML functionality (Xpath, XSLT, etc.)
The result of my search was somewhat inconclusive, though I did find
- the 4suite elements of PyXml are pure Python and very functional
- I found a passing mention that the PyXml library will dynamically
select an appropriate library depending on what is available.
Beyond this, I haven't yet found any documentation or description about
how to select from the various library components. In particular, I'd
like to find some recipes for writing portable XML-handling code using
Xpath and/or XSLT.
Does anyone have any pointers that might help me? Is there a Jython
Wiki page covering this topic? (I tried a search for Jython + PyXml and
didn't find too much.)
While I'm on this topic, does anyone know of any attempts to port Java's
XMLunit (http://xmlunit.sourceforge.net/) to Python/Jython?
If anyone can send me any pointers and/or information, I'd be pleased to
start building a Wiki page on the topic.
From: Kent Johnson <kent37@td...> - 2005-10-31 13:04:08
Graham Klyne wrote:
> While I'm on this topic, does anyone know of any attempts to port Java's
> XMLunit (http://xmlunit.sourceforge.net/) to Python/Jython?
XMLUnit is usable from Jython as-is. It is a Java library so it can be imported directly. On the other hand it relies on Java introspection to discover test cases which is problematic in Jython. Fortunately, the actuall XMLUnit assertions are static methods of the XMLAssert class. The Diff and DetailedDiff classes are also usable standalone. I use XMLUnit extensively from Jython. My test cases subclass unittest.TestCase (not a JUnit or XMLUnit class) so test discovery works as expected. Then I make use of static methods of XMLUnit to implement the actual tests.
Get latest updates about Open Source Projects, Conferences and News.