Re: [xml] use of xmlReplaceNode

On Fri, Mar 05, 2004 at 01:26:09AM +0100, Ines Willenbrock wrote:

just like to ask, what the propper use of xmlReplaceNode is.

if I do somethink like

someNode = xmlReplaceNode(anyNode, newNode)

someNode points to anyNode, as expected, but the contents of anyNode are 
the same as before, and not, as I expected, the contents of anyNode.

  anyNode is replaced by newNode in the tree. anyNode is returned
(hence someNode is anyNode, once removed from its context) so that
the old content can be saved elsewhere in the document (or freed
with xmlFreeNode).


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]