On Thu, Feb 17, 2005 at 08:59:24PM +0100, Aron Stansvik wrote: > 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.
There is number of simplifications in your approach, like external parsed entities, encoding conversions. http://xmlsoft.org/html/libxml-parser.html#xmlByteConsumed From a normal parser you can call this. This is more complex than you may think. I don't think on can get the parsr from a reader but the option exists. > 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, It's like the I/O from other APIs ! http://xmlsoft.org/xmlio.html#Example2 http://xmlsoft.org/examples/index.html#InputOutput Daniel -- Daniel Veillard | Red Hat Desktop team http://redhat.com/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ _______________________________________________ xml mailing list, project page http://xmlsoft.org/ xml@gnome.org http://mail.gnome.org/mailman/listinfo/xml