Re: [xml] Extracting multiple XML fragments of the same type

On Fri, Aug 23, 2002 at 11:56:52AM +0200, Holger Rauch wrote:
Hi Daniel!

Here are my latest news on the subject: I've now recompiled libxml2
version 2.4.23 on Solaris 8 using only "-g" for CFLAGS. I started setting
a breakpoint in xmlDocCopyNode, as you suggested. I then stepped into
every function call and noticed that doc (originally passed to
xmlDocCopyNode()) never appears on the left side of an assignment
statement. This basically means it is left as it is. Shouldn't something

doc->children = ret

be present in xmlDocCopyNode() (after the call xmlStaticCopyNode())?

  No, the goal is to prepare a copy to be plugged in the target document,
not to modify the target document. Doing doc->children = ret would just generate
an hard coded semantic completely different from the existing one,
break applications, and generate memory leaks.
  Your code has to plug the result in the document at the proper place.


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]