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


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

Help with ElementTree

Started byLarry Martell <larry.martell@gmail.com>
First post2015-04-09 13:59 -0400
Last post2015-04-09 13:59 -0400
Articles 1 — 1 participant

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


Contents

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

#88749 — Help with ElementTree

FromLarry Martell <larry.martell@gmail.com>
Date2015-04-09 13:59 -0400
SubjectHelp with ElementTree
Message-ID<mailman.179.1428602356.12925.python-list@python.org>
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

[toc] | [standalone]


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


csiph-web