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


Groups > comp.lang.python > #88749

Help with ElementTree

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <larry.martell@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; '-larry': 0.09; 'part,': 0.09; 'subject:Help': 0.11; '00:00:00': 0.16; 'trying': 0.19; 'seems': 0.21; 'to:name:python-list@python.org': 0.22; 'this?': 0.23; 'skip:e 30': 0.24; 'looks': 0.24; "i've": 0.25; 'this:': 0.26; 'values': 0.27; '(this': 0.29; 'xml': 0.29; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; 'anyone': 0.31; 'file': 0.32; 'thanks!': 0.32; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'hours': 0.66
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=9ToXenot8rZY2ER05oulNaTLesDgFeZAxTp2EIz38Hg=; b=iJIgukB8hHuDq5jcFgy6W6lvUwD0nszfodUnf8hzDjQn7AKjXD1TQkYncfhD2SLnUH euUVngkO8Fna9z3pM5d/By41RwbUP4YzLPvEO0xyAnBKC6ktoLq/M+4r1feMvAFopyAd 5Aye8+ivjgbeGStNKG92sBUubfWn80AZMEvqFia3JWJGvx1eefClW7W/17JNWqQfWxyr +FQ4IbEIutTn28A9H8ulEwRMx1+HRMybK2YDKJiNO3D6MN04tf4odwNHHVPKVorbSUcJ 4EngryqWbZSHOuyWsPhXnGczEMoxRE4A6vvE00Pu4WFANqPpDO+rrUbVB6nvEMbXflZh ntxQ==
MIME-Version 1.0
X-Received by 10.194.24.35 with SMTP id r3mr61601966wjf.125.1428602348604; Thu, 09 Apr 2015 10:59:08 -0700 (PDT)
Date Thu, 9 Apr 2015 13:59:08 -0400
Subject Help with ElementTree
From Larry Martell <larry.martell@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.179.1428602356.12925.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1428602356 news.xs4all.nl 2864 [2001:888:2000:d::a6]:45805
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:88749

Show key headers only | View raw


I have an XML file that looks like this (this is just the pertinent
part, the file is huge):

<?xml version="1.0"?>
<Root>
  <Doc Type="CCI">
    <Node Name="SystemConfig" Section="yes">
        <Node Name="Environment">
           <Parameter Name="ToolName">
              <Value>
                 <Default>KA21</Default>
                 <Current>KA21</Current>
             </Value>
           </Parameter>
         </Node>
      </Node>

    <Node Name="Events" Section="yes">
       <Parameter Name="LastEventExportTime">
         <Value>
           <Default>00:00:00</Default>
           <Current>15/03/2014 05:56:00</Current>
         </Value>
       </Parameter>
    </Node>
  </Doc>
</Root>

I would like to use ElementTree to get 2 values from this:

SystemConfig.Environment.ToolName.Current
Events.LastEventExportTime.Current

I've been trying for hours to get ElementTree to give me these 2
values, but nothing I do seems to work. Can anyone help me with this?

Thanks!
-larry

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


Thread

Help with ElementTree Larry Martell <larry.martell@gmail.com> - 2015-04-09 13:59 -0400

csiph-web