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



Hi Daniel!

Thanks for your quick reply!

On Fri, 23 Aug 2002, Daniel Veillard wrote:

[...] 
  No, the goal is to prepare a copy to be plugged in the target document,
[...]
  Your code has to plug the result in the document at the proper place.

OK, but don't the API docs on xmlDocCopyNode() read

Do a copy of the node to a given document.

Following your suggestion, do I have to use something like

doc = xmlNewDoc( "1.0" );
newNode = xmlDocCopyNode( curNode, doc, 1 );
doc->children = newNode;

in my code? (curNode points to a fragment of the original document, and 
I would like to create a new document containing only the fragment
curNode currently points to.) But I must admit that I don't
understand the meaning (and the necessity) of the doc parameter in
xmlDocCopyNode(). To me, it seems it is only used for making

newNode->doc

to a new document (at least that's the impression I got from debugging my 
code).

Please enlighten me on this issue. Thanks a lot!

Kind regards,

        Holger





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