----------------------------------------
Feature #1224: Add incremental feed support to pushtree
http://foundry.zepheira.com/issues/1224
Author: Uche Ogbuji
Status: New
Priority: Normal
Assigned to: David Beazley
Category:
Target version:
Pushtree supports incremental parsing of a complete XML source, but it does not as it is now support incremental feed of the parser with XML, say coming in over a socket. Something like:
<pre>
from amara.pushtree import pushtree
SCALE = 100000
def receive_nodes(n):
print n.xml_attributes[u'x'],
parser = pushtree_incremental("a/b", receive_nodes)
parser.feed("<a>")
for n in xrange(SCALE):
parser.feed("<b x='%i'/>"%n)
parser.feed("</a>")
parser.close()
</pre>
Notice how one can push snippets to pushtree_incremental as they come in. Clearly such snippets will not need to be well formed, as long ad the entire document is well-formed by the time the parse is closed.
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://foundry.zepheira.com/my/account
Just for a bit of background, this would mean one could use Amara as the parser for XMPP streams for instance which would be rather great.