[xml] truncated bytes in xml

Hi , 

I am  using libxml2 in an embedded environment . 
I am trying to use the xmlwriter API's to write xml. 

some of the blocks have a sizeable amount of data ( >1000 bytes ) . 
I am using code similar to this to write each node 

xmlNodePtr pDom ; 





xmlTextWriterStartElement(writer,(const xmlChar *)kElem1);

xmlTextWriterWriteString(writer , BAD_CAST GetData() ); // line 2 


// 2nd element 

// 3rd element 



//write out xml to file system 

xmlOutputBufferPtr buffptr= xmlOutputBufferCreateIO (WriteCallbackFunction,CloseCallbackFunction, (void *)&file, NULL);

if(buffptr == NULL)

return false

// Buffer Ptr ,doc , currentnode , level , format , encoding 

xmlNodeDumpOutput(buffptr, pDom->doc, pDom , 00, NULL);


return true;

the problem is that  data  is missing in the final xml file. 

Part of the data for Node 1 is written but the rest of the nodes are absent 

something like 

I have tried replacing the xmlTextWriterWriteString   with other similars API's such as xmlTextWriterWriteRaw and xmlTextWriteWriteBase64 but havent had any success ! 

Is anyone aware of any issues with this or a recommendation for a better way to do this . 


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