Solved! (Was: Re: [xml] Extracting multiple XML fragments of the same type



Hi!

I was (finally) able to make it work (might be useful to other people and 
maybe also for the docs):

1. create a new XML document

doc = xmlNewDoc( "1.0" );

2. copy the fragment that the new doucment should contain

newNode = xmlDocCopyNode( curNode, doc, 1 );

3. Make newNode the root element of the newly created document

(void) xmlDocSetRootElement( doc, newNode );

4. Check the result using xmlDocDump to stdout

xmlDocDump( stdout, doc );

Greetings,

        Holger





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