Aahz wrote:
> In article <4986bfd7$0$9385$ba4ac...@news.orange.fr>,
> m.banaouas wrote:
>> Working with the ElementTree module, I looked for clone element
>> function but not found such tool:
>
> Have you tried using copy.deepcopy()?
While being the most obvious solution, calling deepcopy() on a
In article <4986bfd7$0$9385$ba4ac...@news.orange.fr>,
m.banaouas wrote:
>
>Working with the ElementTree module, I looked for clone element
>function but not found such tool:
Have you tried using copy.deepcopy()?
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
We
En Mon, 02 Feb 2009 14:21:29 -0200, m.banaouas
escribió:
My python version is 2.4.4
def SubElement(parent, tag, attrib={}, **extra):
Can you tell me how does "parent" issue could be solved by SubElement ?
Simply because you *have* to pass a parent to the function...
I'm looking for how t
My python version is 2.4.4
def SubElement(parent, tag, attrib={}, **extra):
Can you tell me how does "parent" issue could be solved by SubElement ?
I'm looking for how to determine element parent just by asking element it self.
It seems like element doesn't know witch is its parent, while any par
Gabriel Genellina wrote:
En Mon, 02 Feb 2009 12:37:36 -0200, Gerard Flanagan
escribió:
e = ET.fromstring(s)
def clone(elem):
ret = elem.makeelement(elem.tag, elem.attrib)
ret.text = elem.text
for child in elem:
ret.append(clone(child))
return ret
f = clone(e)
En Mon, 02 Feb 2009 12:37:36 -0200, Gerard Flanagan
escribió:
e = ET.fromstring(s)
def clone(elem):
ret = elem.makeelement(elem.tag, elem.attrib)
ret.text = elem.text
for child in elem:
ret.append(clone(child))
return ret
f = clone(e)
You forget the tail attri
m.banaouas wrote:
Hi all,
Working with the ElementTree module, I looked for clone element function but not
found such tool:
def CloneElment(fromElem, destRoot = None)
fromElem is the element to clone
destRoot is the parent element of the new element ; if None so the new element
will be child of
Hi all,
Working with the ElementTree module, I looked for clone element function but not
found such tool:
def CloneElment(fromElem, destRoot = None)
fromElem is the element to clone
destRoot is the parent element of the new element ; if None so the new element
will be child of fromElem parent. The