From: James B. <bu...@pe...> - 2000-11-15 14:52:42
|
Hello, I am using Jpython for static Java and SQL generation from XML files. I have used the JDOM API from Python directly, but I definitely would like to see compliance with Python's standard XML library. Is anyone working on that? I would like to get involved with the Jython project - does anyone see compliance as valuable? Jim |
From: Robert W. B. <rb...@di...> - 2000-11-15 16:23:20
|
Hello Jim, On Wed, 15 Nov 2000, James Bullard wrote: > Hello, I am using Jpython for static Java and SQL generation from XML files. > I have used the JDOM API from Python directly, but I definitely would like > to see compliance with Python's standard XML library. Is anyone working on > that? I would like to get involved with the Jython project - does anyone see > compliance as valuable? > > Jim No, I don't know of anybody working on that. Yes, compliance is good. Has the xml-sig defined what to be compliant means? Not meant to be rhetorical- it just seems They were in a terrible rush to make 2.0. I really don't know the answer, so nobody take that the wrong way :) Note: there is a wealth of java xml tools that have not left me wanting for CPython's import xml. The advantage comes from when you switch between CPython and Jython and want to use the same modules- I have not needed that yet, but it always seems a noble goal and a situation where one learns from the other. It seems that a good plan would be to join the Jython lists, and the xml-sig lists, then narrow down what a 'compliant' patch would involve. I'm sure jython and the xml-sig could benefit. Best wishes, Robert |
From: <bc...@wo...> - 2000-11-15 19:54:23
|
[James Bullard] [cc'ed to Lars Marius Garshol] >Hello, I am using Jpython for static Java and SQL generation from XML files. >I have used the JDOM API from Python directly, but I definitely would like >to see compliance with Python's standard XML library. Is anyone working on >that? I would like to get involved with the Jython project - does anyone see >compliance as valuable? There are some support for java xml parsers in the xml package in CPython2.0. Look at Lib/xml/sax/__init__.py for examples of this. In the CVS version from the XML-SIG there are even more support (in Lib/xml/dom/javadom.py and others). I have no no clue on how it all fits together or how much we can actually use. Which is why Lars is cc'ed, I hope he can shed some light on this topic. Questions to Lars: What do we need to support the xml package in jython? There seems to missing at least a sax drv_xxx for the common java sax libraries. What else? regards, finn |
From: Lars M. G. <la...@ga...> - 2000-11-16 08:44:28
|
* Finn Bock | | What do we need to support the xml package in jython? There seems to | missing at least a sax drv_xxx for the common java sax libraries. | What else? It depends to some extent on what you want. Some of the packages, like xmlproc, for example, can be used in Jython as they are. I would guess that minidom and probably also 4DOM can be used in Jython as well. I think the main thing that is missing is a SAX driver that can map Java SAX 2.0 to Python SAX 2.0, since without this the Python DOMs can't create DOM trees from XML documents. This has been on my list of things to do for a while, but at the moment I've been too busy to do it. It's planned that this driver will be a part of a package called saxtools, which will again be part of the XML-SIG package. But if anyone wants to write such a driver (shouldn't be hard), feel free. I'll be happy to look over it and see that it is done correctly and also to put it into the XML-SIG saxtools. javadom.py should provide what is needed to use the Java DOM implementations with the same interface as the Python ones. Note that this uses Java code only to create DOM trees from XML documents. It hasn't been used for anything as far as I know, but it should still be useful as it stands, although it may need some tweaks here and there. eventdom by Paul Prescod is perhaps the most interesting piece of code that is difficult to port. It needs SAX, DOM and XPath in order to work, and it's the XPath part that may be difficult. It used to be based on Dieter Maurer's PyXPath and it may be that it still is. Whether PyXPath works in Jython or not I don't know. I hope this helps. --Lars M. |
From: <bc...@wo...> - 2000-11-17 20:45:26
|
[Lars Marius Garshol explains what jython needs to support the xml package] >[snipped] > >I hope this helps. It is very helpfull. Thank you for the explanation. I tried to install xml under jython. To install I did this: - Installed PyXML 0.6.2 under CPython2.0. - Copies CPython2.0's Lib/xml to jython Lib/xml directory. - Copies _xmlplus from the CPython2.0 directory to jython Lib/_xmlplus directory. - Added a "python.xml.sax.parser = xml.sax.drivers2.drv_xmlproc" to my registry file. Something works, but most of the tests from 0.6.2's test suite crashes or throws exceptions. There seems to be plenty of room for improvements to its jython integration. If anyone will try to make these improvements, I would like to include the xml package in the jython installer. A CPython compatible API to xml processing would be very valuable. regards, finn |
From: Lars M. G. <la...@ga...> - 2000-11-20 09:03:41
|
* Finn Bock | | I tried to install xml under jython. To install I did this: | | - Installed PyXML 0.6.2 under CPython2.0. | - Copies CPython2.0's Lib/xml to jython Lib/xml directory. | - Copies _xmlplus from the CPython2.0 directory to jython | Lib/_xmlplus directory. | - Added a "python.xml.sax.parser = xml.sax.drivers2.drv_xmlproc" to | my registry file. This last step was wrong. The xmlproc driver in the drivers2 directory is for an older version of SAX 2. I have an unreleased version that handles the new version, which I could make available if there is interest. (Although it does need more development and testing.) | Something works, but most of the tests from 0.6.2's test suite | crashes or throws exceptions. There seems to be plenty of room for | improvements to its jython integration. | | If anyone will try to make these improvements, I would like to | include the xml package in the jython installer. A CPython | compatible API to xml processing would be very valuable. I would love to help, but realistically my time is very limited both this month and the next, so I doubt that I will get much done during that time. After that I may be able to help. Meanwhile you may try to post to the XML-SIG mailing list and ask for volunteers. --Lars M. |
From: <bc...@wo...> - 2000-11-20 22:24:09
|
[Lars Marius Garshol] >[...] I have an unreleased >version that handles the new version, which I could make available if >there is interest. (Although it does need more development and >testing.) By all means, please show it. James Bullard have already expressed an interrest in working at the jython / XML integration. regards, finn |