[erlang-questions] xmerl_scan for XMPP -- too much lookahead?
Gleb Peregud
gleber.p@REDACTED
Wed Sep 23 16:07:37 CEST 2009
Hi
You could have seen it already :) But nevertheless there is exmpp [1]
library from Process One. It supports such things:
1: http://support.process-one.net/doc/display/EXMPP/
HTH.
Gleb Peregud
On Wed, Sep 23, 2009 at 15:34, Tony Garnock-Jones <tonyg@REDACTED> wrote:
> Hi all,
>
> I'm trying to use xmerl_scan to handle XMPP stanzas, and I think I've
> found a problem with it. I don't think it's intended for streaming XML
> in XMPP-like interleaved-request-and-response-document situations.
>
> The attached program feeds the string "<opentag>" to xmerl_scan. I would
> have expected to receive the open-tag event before blocking for more
> data, but instead it requires at least one more character of input data
> before it will emit the open-tag event! If I instead pass "<opentag> ",
> with a space after the close-bracket, it emits the open-tag event as
> expected, plus the start of an xmlText, before blocking for more data.
>
> My question, then, is:
>
> Is this a bug? Should xmerl_scan supply the open-tag event before
> blocking, when it is fed "<opentag>"?
>
> (The specific context of this problem is dealing with the
> <stream:stream> sent by the server at the handshake stage of XEP-114.)
>
> Regards,
> Tony
>
> P.S.: to run the attached program,
> $ erlc lookaheadbug.erl && erl -run lookaheadbug go
> --
> [][][] Tony Garnock-Jones | Mob: +44 (0)7905 974 211
> [][] LShift Ltd | Tel: +44 (0)20 7729 7060
> [] [] http://www.lshift.net/ | Email: tonyg@REDACTED
>
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
More information about the erlang-questions
mailing list