[xml] Problems with realtime XML processing using xmlreader interface


I am trying to make XMPP (Jabber) python library based on libxml2,
but I have encountered several problems.

The first is that the xmlreader interface is broken when used to process
XML streams as they come. The Expand function assumes a node is fully
read, when it finds the next node instead of waiting just for the end of
the current node. The problem is I may never receive next node unless
I process the current one. I have reported this bug (with patch
attached) in bugzilla http://bugzilla.gnome.org/show_bug.cgi?id=113580.

This fixes the libxml2 library, but the python bindings are also broken 
- high-level IO routines are used (like C fopen()) which block when all
requested data is not available. So even when whole node is available on 
input stream it will be not processed unless whole chunk is read. But
the node usually is shorter than a chunk. This is also reported in
bugzilla: http://bugzilla.gnome.org/show_bug.cgi?id=113578
The bug report also contains a simple workaround.

The patch and the workaround together fix all the "blocking" problems
for me. I hope some solution will be included in the next official
libxml2 release.


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