Re: [xml] Access violations with xmlDocDumpMemory
- From: Daniel Veillard <veillard redhat com>
- To: Andreas Tscharner <andreas tscharner metromec ch>
- Cc: xml gnome org
- Subject: Re: [xml] Access violations with xmlDocDumpMemory
- Date: Tue, 11 Jul 2006 04:28:04 -0400
On Tue, Jul 11, 2006 at 09:48:52AM +0200, Andreas Tscharner wrote:
I'm creating a new document in the memory. The document is well formed
and if I save it to the file system using xmlSave[Format]FileEnc, I get
the exspected result. The problem is that I need the document in a
string, so I thought to use one of xmlDocDump*Memory* family. The
document size does not matter, I tried from 4k to 2.5MiB...
But now I'm having a problem with xmlDocDumpMemory in all flowers (e.g.
with or without *Format and *Enc). No matter which of these functions I
call, I always get an access violation.
Are there any preconditions I need to fulfill to make it work?
I'm using the Windows version 2.6.24 from Igor (also tried 2.6.22+, but
the same results) with Delphi/Pascal bindings.
No idea except in that function it's the library which allocates the
output, and if you have allocator or binding problems that could very well
show up at that point.
Try to use xmlSaveToBuffer and then copy the buffer content, that
should garantee that memory allocation don't cross boundaries between
languages and toolkits.
Daniel Veillard | Red Hat http://redhat.com/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
] [Thread Prev