[xml] Dump document to a buffer without xml version

2014-08-20 Thread Iñigo Martínez
Hi: I'm working with a protocol based on XML, something like: I can successfully parse these messages using xmlReadMemory and navigating through the tree. When trying to create my own messages I can create them successfully this way: doc = xmlNewDoc(NULL); node = xmlNewNode(NULL, BAD_CAST "Com

Re: [xml] Dump document to a buffer without xml version

2014-08-20 Thread Iñigo Martínez
ards, 2014-08-20 19:04 GMT+02:00 Iñigo Martínez : > Hi: > > I'm working with a protocol based on XML, something like: > > Receiver="P2"> > > I can successfully parse these messages using xmlReadMemory and > navigating through the tree. When trying to crea

Re: [xml] Dump document to a buffer without xml version

2014-08-21 Thread Iñigo Martínez
quot;P1"); xmlNewProp (node, BAD_CAST "Receiver", BAD_CAST "P2"); xmlNewChild (node, NULL, BAD_CAST "GetData", NULL); buffer = xmlBufferCreate (); if (xmlNodeDump(buffer, NULL, cmd, 0, 0) == -1) { fprintf (stderr, "Error saving

Re: [xml] Dump document to a buffer without xml version

2014-08-22 Thread Iñigo Martínez
Yeah, it's ok, and the answer is totally valid. I only wondered if my approach had any known drawback. Thank you very much :) 2014-08-22 9:16 GMT+02:00 Daniel Veillard : > On Fri, Aug 22, 2014 at 08:34:37AM +0200, Iñigo Martínez wrote: >> It looks like a longer way. I mean, with

Re: [xml] Dump document to a buffer without xml version

2014-08-22 Thread Iñigo Martínez
In theory. > So the function that strips the header is part of my wrapper functions. E > > On 8/22/2014 4:01 AM, Iñigo Martínez wrote: > > Yeah, it's ok, and the answer is totally valid. I only wondered if my > approach had any known drawback. > > Thank you very much :)

[xml] Memory leaks

2014-08-25 Thread Iñigo Martínez
Hi, I have been looking at the memory usage of my programs using libxml2 y using valgrind, and I have seen these messages: ==22134== Invalid read of size 8 ==22134==at 0x519482F: xmlFreeNode (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1) ==22134==by 0x400A02: main (test-command.c:51) ==2

Re: [xml] Memory leaks

2014-08-25 Thread Iñigo Martínez
:33, Iñigo Martínez wrote: >> >> Hi, >> >> I have been looking at the memory usage of my programs using libxml2 y >> using valgrind, and I have seen these messages: >> >> ==22134== Invalid read of size 8 >> ==22134==at 0x519482F: xmlFreeNode (in >&g