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


Groups > comp.lang.python > #88778

Re: Help with ElementTree

From Stefan Behnel <stefan_ml@behnel.de>
Subject Re: Help with ElementTree
Date 2015-04-10 13:32 +0200
References <CACwCsY4-3_7RBtx2LTLZ6pEAk-qW31XxeZz4aFVCmyK6f4Tong@mail.gmail.com> <mg6h07$uh$1@ger.gmane.org> <CACwCsY63BwubfhmNydzsu8Pg5qSKt6MJ_-N44hh0+yBSmZM7Sg@mail.gmail.com> <CACwCsY5vfpqGnYyCLi-7UVGNTm5VZbGddDPpW6UX+=cygUfUng@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.203.1428665552.12925.python-list@python.org> (permalink)

Show all headers | View raw


Larry Martell schrieb am 10.04.2015 um 12:49:
>> root.find("Doc/Node[@Name='Events']/Parameter[@Name='LastEventExportTime']/Value/Current").text
>> root.find("Doc/Node[@Name='SystemConfig']/Node[@Name='Environment']/Parameter[@Name='ToolName']/Value/Current").text
> 
> So I tested this on a machine running 2.7, but then when I deployed it
> to my client's machine it did not work. Turns out they're running 2.6
> which I find does not support searching for attributes using the
> [@attribute] syntax. They do not want to upgrade, so I have to find a
> way to do this without using that. :-(

Do they, by any chance, have lxml installed on their machine? If so, you
could use that as a (pretty much) drop-in replacement for ElementTree, with
a substantially larger feature set.

Stefan

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


Thread

Re: Help with ElementTree Stefan Behnel <stefan_ml@behnel.de> - 2015-04-10 13:32 +0200

csiph-web