Support for Sax's createStream + some extra fields in the data structure for easier querying #1

Merged
merged 1 commit into from Jan 20, 2012

3 participants

@mattiasb
  • Added support for sax's new createStream method
  • Added some extra fields for querying the data. Not much, but was handy for me. Might be a bit slower.
  • Changed the test accordingly.

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!

@mattiasb mattiasb * 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.
b7b6715
@thejh
Owner

Looks good to me. I'll probably merge and publish it later today.

@mattiasb

Sweet!
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. :)

@thejh
Owner

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.

@mattiasb

Hm yeah, something like that. Will see if I'll get this done after work tonight. :)

@thejh
Owner

@moonlite Hmm, no update? Guess I'll just merge this for now.

@thejh thejh merged commit b43d8ba into thejh:master Jan 20, 2012
@mattiasb
@topliceanu

parseStream still isn't published on npm :(

@thejh
Owner

@topliceanu Sorry about that, published.

@topliceanu

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment