Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #88780 > unrolled thread
| Started by | Larry Martell <larry.martell@gmail.com> |
|---|---|
| First post | 2015-04-10 08:06 -0400 |
| Last post | 2015-04-10 08:06 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Help with ElementTree Larry Martell <larry.martell@gmail.com> - 2015-04-10 08:06 -0400
| From | Larry Martell <larry.martell@gmail.com> |
|---|---|
| Date | 2015-04-10 08:06 -0400 |
| Subject | Re: Help with ElementTree |
| Message-ID | <mailman.205.1428667778.12925.python-list@python.org> |
On Fri, Apr 10, 2015 at 7:32 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
> 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.
No, they don't. What I ended up doing is, I got the 2.7 xml/etree and
I copied that to the 2.6 dir as xml/etree27 and imported that and it
works.
Back to top | Article view | comp.lang.python
csiph-web