[Akara - Feature #1224] (New) Add incremental feed support to pushtree

0 views
Skip to first unread message

red...@foundry.zepheira.com

unread,
Jan 13, 2011, 5:55:48 PM1/13/11
to
Issue #1224 has been reported by Uche Ogbuji.

----------------------------------------
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

red...@foundry.zepheira.com

unread,
Jan 14, 2011, 7:50:54 AM1/14/11
to
Issue #1224 has been updated by Sylvain Hellegouarch.


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.

Reply all
Reply to author
Forward
0 new messages