Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25472 > unrolled thread

Re: jython lacks working xml processing modules?

Started bygaodexiaozheng@gmail.com
First post2012-07-17 01:35 -0700
Last post2012-07-18 10:09 +0200
Articles 7 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: jython lacks working xml processing modules? gaodexiaozheng@gmail.com - 2012-07-17 01:35 -0700
    Re: jython lacks working xml processing modules? Stefan Behnel <stefan_ml@behnel.de> - 2012-07-17 11:31 +0200
    Re: jython lacks working xml processing modules? Matej Cepl <mcepl@redhat.com> - 2012-07-17 11:39 +0200
      Re: jython lacks working xml processing modules? Stefan Behnel <stefan_ml@behnel.de> - 2012-07-17 12:02 +0200
        Re: jython lacks working xml processing modules? gaodexiaozheng@gmail.com - 2012-07-17 20:12 -0700
        Re: jython lacks working xml processing modules? gaodexiaozheng@gmail.com - 2012-07-17 20:12 -0700
          Re: jython lacks working xml processing modules? Matej Cepl <mcepl@redhat.com> - 2012-07-18 10:09 +0200

#25472 — Re: jython lacks working xml processing modules?

Fromgaodexiaozheng@gmail.com
Date2012-07-17 01:35 -0700
SubjectRe: jython lacks working xml processing modules?
Message-ID<dbb0ce68-8984-4d18-9fe7-2ad1a77f7e31@googlegroups.com>
在 2003年11月24日星期一UTC+8下午7时42分31秒,Paul Boddie写道:
> janeaustine50@hotmail.com (Jane Austine) wrote in message news:&lt;ba1e306f.0311201805.9df1d9@posting.google.com&gt;...
> &gt; I&#39;m trying to parse an xml file with jython (not through java parsers
> &gt; like xerces).
> &gt; 
> &gt; I tried minidom in jython 2.1 and 2.2a but all failed.
> &gt; 
> &gt; What can I do? The last resort would be using java parsers. Then how
> &gt; can I use them like python xml parsers? It seems like javadom and
> &gt; javasax has something to do, but I don&#39;t know how.
> 
> The Java parsers seem to work quite well with the xml.dom.javadom
> package. First, update your CLASSPATH with references to the necessary
> .jar files - this can be a frustrating process, but I found that
> xercesImpl-2.5.0.jar and xml-apis.jar were a good combination:
> 
>   export CLASSPATH=.../xercesImpl-2.5.0.jar:.../xml-apis.jar
> 
> Then, start jython and try the following:
> 
>   import xml.dom.javadom
>   impl = xml.dom.javadom.XercesDomImplementation()
>   # Use your own filename below!
>   doc = impl.buildDocumentFile(&quot;example.xml&quot;)
>   # Now, try some PyXML-style DOM properties and methods.
>   doc.childNodes
>   doc.childNodes[0].getAttribute(&quot;some-attr&quot;)
> 
> I&#39;d seen javadom lurking in PyXML before now, but it&#39;s a nice surprise
> to see that it works rather well, especially since I&#39;ve never seen any
> evidence of anyone using it (as far as I remember).
> 
> Paul

hi,do you know the PyXML whether can be supported by Jython ?
Looking forward to your reply!
Thanks

[toc] | [next] | [standalone]


#25476

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-07-17 11:31 +0200
Message-ID<mailman.2207.1342517515.4697.python-list@python.org>
In reply to#25472
gaodexiaozheng@gmail.com, 17.07.2012 10:35:
> hi,do you know the PyXML whether can be supported by Jython ?

PyXML is a dead project, don't use it.

You can use ElementTree in Jython, just as in Python.

Stefan

[toc] | [prev] | [next] | [standalone]


#25479

FromMatej Cepl <mcepl@redhat.com>
Date2012-07-17 11:39 +0200
Message-ID<ju3bqj$rkf$1@ns.felk.cvut.cz>
In reply to#25472
On 17/07/12 10:35, gaodexiaozheng@gmail.com wrote:
>> &gt; I&#39;m trying to parse an xml file with jython (not through java parsers
>> &gt; like xerces).

https://code.google.com/p/jython-elementtree/ ???

[toc] | [prev] | [next] | [standalone]


#25480

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-07-17 12:02 +0200
Message-ID<mailman.2209.1342519373.4697.python-list@python.org>
In reply to#25479
Matej Cepl, 17.07.2012 11:39:
> On 17/07/12 10:35, gaodexiaozheng@gmail.com wrote:
>>> &gt; I&#39;m trying to parse an xml file with jython (not through java
>>> parsers
>>> &gt; like xerces).
> 
> https://code.google.com/p/jython-elementtree/ ???

Note that this ships with Jython 2.5.

Stefan

[toc] | [prev] | [next] | [standalone]


#25555

Fromgaodexiaozheng@gmail.com
Date2012-07-17 20:12 -0700
Message-ID<e84977ef-a6a9-4589-bb9f-c9ca441fa989@googlegroups.com>
In reply to#25480
在 2012年7月17日星期二UTC+8下午6时02分31秒,Stefan Behnel写道:
> Matej Cepl, 17.07.2012 11:39:
> &gt; On 17/07/12 10:35, gaodexiaozheng@gmail.com wrote:
> &gt;&gt;&gt; &amp;gt; I&amp;#39;m trying to parse an xml file with jython (not through java
> &gt;&gt;&gt; parsers
> &gt;&gt;&gt; &amp;gt; like xerces).
> &gt; 
> &gt; https://code.google.com/p/jython-elementtree/ ???
> 
> Note that this ships with Jython 2.5.
> 
> Stefan

Got that,thanks!
However,there is one project implemented by Python used PyXML and now my Jython project has to depend on it ,so I am afraid that if Jython doesn't support PyXML,then my jython project can not depend on the original Python project ,then my jython project maybe can not move on unless I find another project to take place of the original Python project. 

[toc] | [prev] | [next] | [standalone]


#25556

Fromgaodexiaozheng@gmail.com
Date2012-07-17 20:12 -0700
Message-ID<mailman.2262.1342581136.4697.python-list@python.org>
In reply to#25480
在 2012年7月17日星期二UTC+8下午6时02分31秒,Stefan Behnel写道:
> Matej Cepl, 17.07.2012 11:39:
> &gt; On 17/07/12 10:35, gaodexiaozheng@gmail.com wrote:
> &gt;&gt;&gt; &amp;gt; I&amp;#39;m trying to parse an xml file with jython (not through java
> &gt;&gt;&gt; parsers
> &gt;&gt;&gt; &amp;gt; like xerces).
> &gt; 
> &gt; https://code.google.com/p/jython-elementtree/ ???
> 
> Note that this ships with Jython 2.5.
> 
> Stefan

Got that,thanks!
However,there is one project implemented by Python used PyXML and now my Jython project has to depend on it ,so I am afraid that if Jython doesn't support PyXML,then my jython project can not depend on the original Python project ,then my jython project maybe can not move on unless I find another project to take place of the original Python project. 

[toc] | [prev] | [next] | [standalone]


#25560

FromMatej Cepl <mcepl@redhat.com>
Date2012-07-18 10:09 +0200
Message-ID<ju5qsm$1n04$1@ns.felk.cvut.cz>
In reply to#25556
On 18/07/12 05:12, gaodexiaozheng@gmail.com wrote:
> However,there is one project implemented by Python used PyXML and now
> my Jython project has to depend on it ,so I am afraid that if Jython
> doesn't support PyXML,then my jython project can not depend on the
> original Python project ,then my jython project maybe can not move on
> unless I find another project to take place of the original Python
> project.

I think, if possible, such project should switch out of PyXML anyway. If 
you make them nice patch to port them to standard ElementTree (and as a 
side-effect make the project working with Jython), they will like you. I 
guess.

Matěj

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web