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


Groups > comp.lang.python > #79043

Jython or Pyton issue-- Kindly Help me....

Newsgroups comp.lang.python
Date 2014-10-13 04:39 -0700
Message-ID <91eb3378-958d-45e0-8741-a800ae681260@googlegroups.com> (permalink)
Subject Jython or Pyton issue-- Kindly Help me....
From Venugopal Reddy <venugopal.reddy@tspl.com>

Show all headers | View raw


Dear All,

How to write a program for reading or parsing the XML file in Sub root Wise.

For ex:

Below XMl, I want to read/ parse first country details and here also two year tag values are there.. Here I need to read/parse first year value only measn '2008' Only..After that I need to read second country details.

Please help me .. i am struggling to get this solution..

<?xml version="1.0"?>
<data>
    <country name="Liechtenstein">
        <rank>1</rank>
        <year>2008</year>
        <year>2009></year>
        <gdppc>141100</gdppc>
        <neighbor name="Austria" direction="E"/>
        <neighbor name="Switzerland" direction="W"/>
    </country>
    <country name="Singapore">
        <rank>4</rank>
        <year>2011</year>
        <gdppc>59900</gdppc>
        <neighbor name="Malaysia" direction="N"/>
    </country>
    <country name="Panama">
        <rank>68</rank>
        <year>2011</year>
        <gdppc>13600</gdppc>
        <neighbor name="Costa Rica" direction="W"/>
        <neighbor name="Colombia" direction="E"/>
    </country>
</data> 

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Jython or Pyton issue-- Kindly Help  me.... Venugopal Reddy <venugopal.reddy@tspl.com> - 2014-10-13 04:39 -0700
  Re: Jython or Pyton issue-- Kindly Help me.... Ian Kelly <ian.g.kelly@gmail.com> - 2014-10-13 09:43 -0600
    Re: Jython or Pyton issue-- Kindly Help me.... Venugopal Reddy <venugopal.reddy@tspl.com> - 2014-10-14 02:46 -0700
      Re: Jython or Pyton issue-- Kindly Help me.... Peter Otten <__peter__@web.de> - 2014-10-14 12:43 +0200
        Re: Jython or Pyton issue-- Kindly Help me.... Venugopal Reddy <venugopal.reddy@tspl.com> - 2014-10-14 22:42 -0700
          Re: Jython or Pyton issue-- Kindly Help me.... Peter Otten <__peter__@web.de> - 2014-10-15 09:32 +0200
            Re: Jython or Pyton issue-- Kindly Help me.... Venugopal Reddy <venugopal.reddy@tspl.com> - 2014-10-15 01:35 -0700
              Re: Jython or Pyton issue-- Kindly Help me.... Peter Otten <__peter__@web.de> - 2014-10-15 11:04 +0200

csiph-web