19 Feb
2009
19 Feb
'09
11:53 a.m.
On Feb 19, 2009, at 11:39 AM, luigi scarso wrote:
FOO = etree.Element("FOO") emph = etree.Element("emph") [child.tag for child in foo.iterdescendants(tag = '{urn:oasis:names:tc:opendocument:xmlns:text:1.0 }span' ) ]
['{urn:oasis:names:tc:opendocument:xmlns:text:1.0}span']
span = [child for child in foo.iterdescendants(tag = '{urn:oasis:names:tc:opendocument:xmlns:text:1.0 }span' ) ][0] emph.text = span.text FOO.append(emph) etree.tostring(FOO) '<FOO><emph>foo</emph></FOO>'
Excuse me for being dense: you mean all namespaces have to be explicitly expanded? Thomas