[xml] Question about packing...



  Hi list,

I use a main module to manage an xml tree, plus other functionnalities we don't mind here. This main module calls sub-modules by passing a pointer to an xmlobject, that we will call "SortieXML" here.

The goal is that each submodule add some subtrees to my xml tree. The main problem I have, is that I would like to pack the xml tree ( I don't know if "pack" is the right word ) because of the temporary local node.

Each sub module creates temporary node, add it the to pointer passed in argument, but of course when the main module get the result,
it is wrong.

As an example, I would like to know if there is a way to do that :

-----------------------------------------------------

void example ( SortieXML *xml_out) {

xmlNodePtr toto;
xmlNodePtr titi;

[...]

xmlAddChild ( toto, titi );
xmlAddChild ( xml_out->xmlgetRoot(), toto );

/* Here, everything is fine */


/* Now, I would like to pack the xmldoc in one big thing, something which would allow me to free titi and toto nodes
*
* xmlPack( xml_out);
* xmlFree(toto);
* xmlFree(titi);
*
* I have searched "pack" in the api doc and found nothing. Is there a way to do what I want...
*/


I hope you see what I mean, I use a pretty big source code ( C++ written ) and I use others methods, so I can't give you a file example. I just want to be clear and explain what I'm trying to do, and I don't find this in the API doc ( Maybe I searched bad ).

thanks all,

Remy H.

--
_____________________________________________
Remy HAREL          -        Teamlog        |
____________________________________________|
Linux registered user #224740               |
France Telecom Recherche & Developpement    |
____________________________________________| __________________@ http://www.chezrem.org @|





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