Re: [xml] Access internal xmlParserInputBuffer data
- From: Nikolay Sivov <bunglehead gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] Access internal xmlParserInputBuffer data
- Date: Thu, 21 Jan 2010 02:33:42 +0300
On 1/19/2010 17:46, Daniel Veillard wrote:
On Fri, Jan 15, 2010 at 10:50:15PM +0300, Nikolay Sivov wrote:
Hi.
First on question background. I want to use xmlTextReader API to
access streamed xml data.
Decided to allocate input buffer with xmlAllocParserInputBuffer()
and use read callback to provide xml data
(no choice here for me actually).
Is it safe to manually set 'readcallback' and 'context' fields of
returned xmlParserInputBuffer?
Looking at libxml2 code I don't see any problems with that, but it's
better to ask.
In general I would suggest you try to use
http://xmlsoft.org/html/libxml-xmlreader.html#xmlReaderNewIO
i.e. don't manipulate the buffer directly but let libxml2 callbacks
call you to fill data in as needed instead.
Thanks, seems to fit.
Now if you want to play with the internals, you can, libxml2 exposes
them, but I can't garantee your code won't break something, only solid
testing and careful analysis can really give insurance over such
tweaking,
Of course, I certainly understand.
Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]