[xml] Text writer memory won't write

I'm using a memory text writer as in the function testXmlwriterMemory()
here:  http://www.xmlsoft.org/examples/testWriter.c

I create a buffer, a writer, start a document, write some elements, end
the document.  Every one of the write calls returns 0 (no bytes written,
but no errors either).

Examining the buffer in GDB shows it empty:

   $10 = {
      content = 0x3d6380 "",
      use = 0,
      size = 4096,

Examining the writer's out->context field, it's a void pointer with the
same address as the buffer I handed it when the writer was created.

Examining the writer's out->buffer field shows it contains all the data
I wrote!

   $14 = {
      content = 0x3d73f8 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>...",
      use = 192,
      size = 4096,

I truncated the content field because it was large, but it had my
complete XML document inside it.  So the writer is apparently doing most
of its job, except it won't put any data into my buffer.

Anyone know why this would happen?

Mike Mueller
mike subfocal net

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