[xml] Newbie question



Hi there!

I have a problem with xmlDocDumpMemory when I tried to build a XML file.

My program builds a tree from scratch and then I just tried to dump it in a file, but I only get this:

-------
<?XML VERSION ="1.0">
--EOF--

The rest of tree data never appear.
The same thing happens with xmlSaveFormatFile.

I'm using libxml2 2.6.11 within Fedora.



Just for reference here is a snippet:
-----
xmlDocPtr  documentoXML;
xmlNodePtr rootXML;
xmlNodePtr dispXML = NULL;
xmlNodePtr itemXML = NULL;
xmlChar *cadenaXML;
int tamCadena = 0;

documentoXML = xmlNewDoc((const xmlChar *)XML_HEADER);

rootXML = xmlNewDocNode(documentoXML, NULL,REG_ELEM_DISPOSITIVOS, NULL);      

       
dispXML = xmlNewChild(rootXML, NULL, REG_ELEM_DISPOSITIVO, NULL);
itemXML = xmlNewChild(dispXML, NULL,REG_ELEM_ID, id);
itemXML = xmlNewChild(dispXML, NULL, REG_ELEM_TIPO, tipo);
itemXML = xmlNewChild(dispXML, NULL, REG_ELEM_CONECTADO, REG_CONECT_SI);
  
xmlDocDumpMemory(documentoXML, &cadenaXML, &tamDocumento);

...
-- 
_______________________________________________
http://mail.mexico.com
¡Disponible Ya! Utiliza el Outlook y Outlook Express para bajar tus correos por solo US$24.95 al año

Now available! Download your mail into your computer with Outlook and Outlook Express US$24.95/yr

Powered by www.M3xico.com



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