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


Groups > comp.lang.python > #88424

Re: New to Programming - XML Processing

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <burak.arslan@arskom.com.tr>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.015
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'tutorial': 0.03; 'elements.': 0.07; 'attributes': 0.09; 'objects,': 0.09; 'parsing': 0.09; 'api': 0.11; 'python': 0.11; 'assigned,': 0.16; 'burak': 0.16; 'from:addr:arskom.com.tr': 0.16; 'from:addr:burak.arslan': 0.16; 'from:name:burak arslan': 0.16; 'message-id:@arskom.com.tr': 0.16; 'received:arskomhosting.com': 0.16; 'subject:Programming': 0.16; 'subject:XML': 0.16; 'elements': 0.16; 'wrote:': 0.18; 'examples': 0.20; 'header:User- Agent:1': 0.23; 'parse': 0.24; 'suggested': 0.26; 'header:In- Reply-To:1': 0.27; 'to:2**1': 0.27; 'point': 0.28; 'xml': 0.29; "i'm": 0.30; 'getting': 0.31; 'libraries': 0.31; 'file': 0.32; 'supposed': 0.32; 'regular': 0.32; 'created': 0.35; 'objects': 0.35; 'there': 0.35; 'programming,': 0.36; 'behind': 0.37; 'subject:New': 0.37; 'to:addr:python-list': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'everybody': 0.60; 'most': 0.60; 'new': 0.61; 'here:': 0.62; 'save': 0.62; 'myself': 0.63; 'levels': 0.65; 'teach': 0.65; 'charset:windows-1252': 0.65; 'computers.': 0.84; 'tasked': 0.84; 'terrible': 0.84; 'loves': 0.93; 'directly.': 0.95
Date Wed, 01 Apr 2015 16:44:02 +0300
From Burak Arslan <burak.arslan@arskom.com.tr>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
MIME-Version 1.0
To catperson <me@anonymous.invalid>, python-list@python.org
Subject Re: New to Programming - XML Processing
References <upomhad4fj6sulnr5so8088fdqpo0nk6mu@4ax.com>
In-Reply-To <upomhad4fj6sulnr5so8088fdqpo0nk6mu@4ax.com>
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding quoted-printable
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.11.1427895853.12925.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1427895853 news.xs4all.nl 2968 [2001:888:2000:d::a6]:54098
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:88424

Show key headers only | View raw


On 04/01/15 06:27, catperson wrote:
> I am new to programming, though not new to computers.  I'm looking to
> teach myself Python 3 and am working my way through a tutorial.  At
> the point I'm at in the tutorial I am tasked with parsing out an XML
> file created with a Garmin Forerunner and am just having a terrible
> time getting my head around the concepts.  What I'm looking for is
> some suggested reading that might give me some of the theory of
> operation behind ElementTree and then how to parse out specific
> elements.  Most of what I have been able to find in examples that I
> can understand use very simplistic XML files and this Garmin file is
> many levels of sub-elements and some of those elements have attributes
> assigned, like <Activity Sport="Running">.

As everybody loves objects, there are many libraries that parse xml
documents to regular python objects (with proper hierarchy). These are
supposed to save you from dealing with ElementTree api directly.

Have a look here:

http://stackoverflow.com/questions/19545067/python-joining-and-writing-xml-etrees-trees-stored-in-a-list

Hth,
Burak

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


Thread

New to Programming - XML Processing catperson <me@anonymous.invalid> - 2015-03-31 20:27 -0700
  Re: New to Programming - XML Processing Ben Finney <ben+python@benfinney.id.au> - 2015-04-01 15:08 +1100
  Re: New to Programming - XML Processing Rustom Mody <rustompmody@gmail.com> - 2015-03-31 21:17 -0700
    Re: New to Programming - XML Processing Andrew Farrell <amfarrell@mit.edu> - 2015-03-31 23:27 -0500
    Re: New to Programming - XML Processing Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-01 09:00 +0100
    Re: New to Programming - XML Processing catperson <me@anonymous.invalid> - 2015-04-01 15:33 -0700
      Re: New to Programming - XML Processing sohcahtoa82@gmail.com - 2015-04-01 17:46 -0700
  Re: New to Programming - XML Processing Rustom Mody <rustompmody@gmail.com> - 2015-03-31 21:49 -0700
  Re: New to Programming - XML Processing Andrew Farrell <amfarrell@mit.edu> - 2015-03-31 23:26 -0500
  Re: New to Programming - XML Processing Burak Arslan <burak.arslan@arskom.com.tr> - 2015-04-01 16:44 +0300

csiph-web