Hacker News new | ask | show | jobs
by olau 2673 days ago
Indeed! I was in the same boat - also started writing a client, but wasted too much time on the stupid XML stream idea.

Basically, chatting is message oriented, but the XMPP inventors thought it would be neat to start the connection with a tag like <beginconversation> which would then be dangling for the whole connection, preventing the use of a simple DOM XML parser (remember this is many years ago) for each message.

1 comments

Any XML parser that I know can parse XML in a stream, that's all you need to handle an incoming XMPP stream.

Just an example, here is the XML parser that I wrote in PHP https://github.com/movim/movim/blob/master/lib/moxl/src/Moxl... (127 lines), it basically handle the stream as an input and fire SimpleXML (can also be DOM XML) on the other hand.

This can handle thousands of XMPP messages (called stanza) per second :)

Can it handle plaintext XML suddenly becoming TLS encrypted? Because that's also what happens on any XMPP connection. If it can, then great but I guess it's more an exception than the rule