[jdev] parsing xml (xmpp) with ruby

Remko Tronçon remko at el-tramo.be
Mon Sep 29 01:21:01 CDT 2008


> However, this may not handle the TLS's case though. I haven't looked
> into the details but I suspect I need to handcraft the SAX
> parser for the <stream> tags just to handle this scenario.

A common way of avoiding to write your own SAX parser is to hand it
only chunks that are known to come before TLS. The easiest solution is
to hand it one byte at a time, and check whether TLS has started; you
could hand it chunks that end in '>' as well, although I suspect that
checking on '>' yourself is extra unnecessary overhead, since that's
done in the parser anyway.

cheers,
Remko



More information about the JDev mailing list