[xml] dumping XML file question



Hey there.
 I'm currently working on a project using XML/C++. Now please excuse
me for asking this question, but there is something I'm pondering
upon. The problem is that depending on which file I dump first, just
one of the files will get filled.
Does it have something to do with one of the Dump functions clears the
xml Document after finished dumping?

I have code that looks something like this:

if(f && xml){
//Dumps the xml file cache
 std::cerr << "dumping xmlfile" << std::endl;
 xmlDocFormatDump(xml,doc,0);
 fflush(xml);
 fclose(xml);
 free(xml);
 xml=NULL;

 //Store file
 cur = xsltParseStylesheetFile((const xmlChar*)XSLT_INPUT);
 res = xsltApplyStylesheet(cur,doc,NULL);

 //Dumps the xsl transformation
 xsltSaveResultToFile(f,res,cur);
 fflush(f);
 fclose(f);
 free(f);
 f=NULL;
}


In advance thanks :)
Kenneth Østby



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