Was able to parse 64M of xml to JSON in constant space. (Need to test more).
This was done in haste a late night. I understand if you don't want to apply all of this. If so tell me and I'll split up the patch!
* Added support for sax.js's createStream
* Added some extra code for querying the data. Not much, but was handy for me.
* Changed the test accordingly.
Was able to parse 64M of xml to JSON in constant space.
Looks good to me. I'll probably merge and publish it later today.
I would like to abstract away the implementations of createParser and createStream also since they are identical, but I'm not sure how to do that in a good way, but this works. :)
Maybe you could add a function for both with an if/else? And make two aliases to it. Then you don't need redundant listeners.
Hm yeah, something like that. Will see if I'll get this done after work tonight. :)
@moonlite Hmm, no update? Guess I'll just merge this for now.
parseStream still isn't published on npm :(
@topliceanu Sorry about that, published.