Using elementtree: replacing nodes
andre.roberge at gmail.com
Tue May 2 12:21:06 CEST 2006
Fredrik Lundh wrote:
> André wrote:
> > I've started using elementtree and don't understand how to use it to
> > manipulate and replace nodes.
It was mostly the following step which I couldn`t figure out...
> # 2) mutate the pre element
> pre.tag = "form"
> pre[:] = [form]
> another approach is to build a parent map; see the parent_map code
More information about the Python-list