[XML-SIG] need help with removeChild()
mike at skew.org
Sun Mar 8 05:10:24 CET 2009
narendar rao wrote:
> If we use removeChild(), will it save changes to the file that we are
> editing. If it doesn't, can some one show me how to do that.
With any XML tree API, be it DOM or lxml or ElementTree or Amara or whatever,
you are working with an in-memory model of the document. This model was
derived from the original serialized XML (the file) at parse time. Changes to
the model are confined to the model; they're in memory only. When you're done
making changes, you should produce a new serialization; the means of doing
this varies depending on the API you're using, but you can surely search
through the API docs or tutorials for how to serialize the tree. You can put
that serialization into a file, overwriting the old file if you want.
> Can some one help me in writing this code?
I won't, but would maybe someone else is feeling more charitable.
More information about the XML-SIG