[erlang-bugs] xmerl_sax_parser:stream/2 doesn't know when to stop

Per Melin per.melin@REDACTED
Fri Nov 12 15:07:15 CET 2010


On Fri, Nov 12, 2010 at 1:22 PM, Lars Thorsen <lars@REDACTED> wrote:
> The effect is also expected and I shall try to explain why.
>
> According to the XML a document is defined as:
>
> document         ::=    prolog element Misc*
> Misc     ::=    Comment | PI |  S

I see I didn't do my research properly. Sorry.

My problem is that I'm receiving a constant stream of (not entirely
correct) XML documents over a socket. There is nothing signaling the
end of a document other than the end of the root element.

I can't use a throw from the event callback at the root endElement to
terminate early because I then lose the rest of the unprocessed
buffer, which may contain the start of the next document.

But, no worries, I have a workaround. It's just not as pretty. Again,
sorry for the noise.


More information about the erlang-bugs mailing list