Re: [xml] Text writer memory won't write



On Thu, Jan 18, 2007 at 10:57:25PM -0500, Mike Mueller wrote:
On Thu, Jan 18, 2007 at 07:18:51PM -0800, William M. Brack wrote:
Mike Mueller wrote:
I compiled the test program and it works fine.  It turns out the data
gets dumped into the buffer when you call xmlFreeTextWriter.  I wasn't
freeing the writer until much after I tried to find my data in the
buffer.  Of course, the documentation for this function simply says:

    Deallocate all the resources associated to the writer

Yay for confusing APIs.

  This is standard behaviour to flush on close when doing pipe like
processing, simply to avoid the cost of sync'ing out at every single 
write. Mind you if you use an I/O function which for example send a 
packet to a network interface, your really *do not want* to get a packet
out each time you Write a new attribute to your stream. If that's what
you require, I really suggest you write your own synchronous API, because
except you nobody expects or want this !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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