GNOME Bugzilla – Bug 708125
xmlTextReaderReadState returns EOF when there are still nodes to be read
Last modified: 2021-07-05 13:25:55 UTC
Created attachment 254988 [details] test code that displays the problem xmlTextReadReadState return 3 (that is, XML_TEXTREADER_MODE_EOF) rather than 1 (XML_TEXTREADER_MODE_INTERACTIVE) even though there are more nodes to be read. Attached sample code does one read from the XML "<foo>bar</foo>" and then prints the state. It prints 3. I expected 1. My guess is that it does this because the parser itself has reached end of file. This however makes this function not very useful, and differs from the behavior of ECMA/.NET API (tested with Mono; attaching this test code as well for reference). My libxml2 version is 2.9.0 from Ubuntu 13.04.
Created attachment 254989 [details] C# code for comparison
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.