[xml] libxml2 newbie question about the Reader API

Hello xml readers.

Because of some peoples misuse of XML, I'm now writing a simple
wxWidgets application that needs to process huge XML documents. I've
tested that the libxml2 Reader API can handle the load well.

Now I want my application to give some kind of progress feedback to
the user. Is there a way to obtain the number of bytes read when using
a Reader obtained using the simple xmlReaderForFile() function, or
will I have to set up my own custom I/O handlers with
xmlReaderForIO()? I can't find any example usage of this function
anywhere, and I having a bit of a hard time deciphering how it
actually works. Googling for "xmlReaderForIO" only gives 10 hits (!).

My plan is to just stat() the file for it's size before processing it,
and then use the number of bytes read to calculate progress, so all I
need is the position in the input stream that libxml2 uses.

Greatful for any advice and examples of using custom I/O with the
Reader API. I've looked at the custom I/O code samples at xmlsoft.org,
and I guess they're related to what I need to do.

Best regards,
Aron Stansvik

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