Hacker News new | ask | show | jobs
by jcranmer 486 days ago
AIUI (from talking to people who had to implement XMPP), the problem isn't that "XMPP is XML", the problem is that XMPP is XML done badly. An XMPP connection is essentially a giant XML document that's never closed, which most XML libraries tend to handle very poorly, so you often end up writing your own XML library to handle XMPP. With all of the pain that entails.
1 comments

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.

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.