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


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

Hi Guys... Reading XML using Jython code

Started byVenugopal Reddy <venugopal.reddy@tspl.com>
First post2014-10-09 05:30 -0700
Last post2014-10-10 00:37 +0000
Articles 2 — 2 participants

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


Contents

  Hi Guys... Reading XML using Jython code Venugopal Reddy <venugopal.reddy@tspl.com> - 2014-10-09 05:30 -0700
    Re: Hi Guys... Reading XML using Jython code Denis McMahon <denismfmcmahon@gmail.com> - 2014-10-10 00:37 +0000

#78885 — Hi Guys... Reading XML using Jython code

FromVenugopal Reddy <venugopal.reddy@tspl.com>
Date2014-10-09 05:30 -0700
SubjectHi Guys... Reading XML using Jython code
Message-ID<b24cde8a-6612-4c83-ae81-7683b29f04b5@googlegroups.com>
Am new to python and Jython...

Kindly help me on My issue please !

My Issue is:

XML parsing using Jython..

I am sucessfully reading XML file using xml.etree.ElementTree package .. 
But I have a issue in below scenario . this scenario my code is not working.

In my XML file , One main node is there and Multiple child tags are there. But In Child tags , same name repeated twice (like <subject> tag repeated twice)

This scenario , this package can not read .. 

How can I read very first come tag (means it should read first come <subject> node value only .leave the second come <subject> node value)


Please help me on this....

[toc] | [next] | [standalone]


#78918

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-10-10 00:37 +0000
Message-ID<m179ok$38f$2@dont-email.me>
In reply to#78885
On Thu, 09 Oct 2014 05:30:21 -0700, Venugopal Reddy wrote:

> XML parsing using Jython..

> In my XML file , One main node is there and Multiple child tags are
> there. But In Child tags , same name repeated twice (like <subject> tag
> repeated twice)

> Please help me on this....

Normally, when pulling data from an xml document, you'll get a collection 
of some sort:

Are you trying to select every subject of every child, the first subject 
of every child, the last subject of every child, or some nth subject of 
every child?

You may need to go back to your specification code and look again at how 
you're specifying which node(s) you want to select.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [standalone]


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


csiph-web