Hacker News new | ask | show | jobs
by magicalhippo 485 days ago
SAX parsers should have no issue with that, or? So is the pain that you're forced to use SAX parsing or roll your own?

At least the SAX parsers I've used allowed to get partial "subnode DOMs", which makes it quite easy to use in practice.

That said I've only parsed ~1GB XML files (no embedded binaries), not sure if that counts as large enough.

1 comments

Yup. You can write xmpp parsers with thin wrappers around a push based sax parser. It is not hard, people are just not familiar with sax.

Sure, sax parsers have their limitations, but there are sax parsers that avoid the callback trouble by doing a tree-style fold over the XML structure instead of the linear fold over the XML stream. Not for the server, since it is not super efficient, but writing a client like that is easy peasy.