Re: lxml - minor problem appending new element

2020-02-03 Thread Frank Millman
On 2020-02-03 10:39 AM, Peter Otten wrote: Frank Millman wrote: This is a minor issue, and I have found an ugly workaround, but I thought I would mention it. Like this? children = list(xml) for y in children: print(etree.tostring(y)) if y.get('z') == 'c': child = etree.Ele

Re: lxml - minor problem appending new element

2020-02-03 Thread Peter Otten
Frank Millman wrote: > Hi all > > I usually send lxml queries to the lxml mailing list, but it appears to > be not working, so I thought I would try here. > > This is a minor issue, and I have found an ugly workaround, but I > thought I would mention it. Like this? children = list(xml) for y i

lxml - minor problem appending new element

2020-02-02 Thread Frank Millman
Hi all I usually send lxml queries to the lxml mailing list, but it appears to be not working, so I thought I would try here. This is a minor issue, and I have found an ugly workaround, but I thought I would mention it. In Python I can iterate through a list, and on a certain condition app