Remko Tronçon wrote:
> > The problem of receiving a half-stanza that's not well formed is still
> > here.
> 
> To me, this means that you haven't solved the problem correctly, and
> that you're still using the wrong type of parser that expects your
> document to be complete. A real incremental parser never throws an
> exception on an incomplete piece of XML of any kind. I'm also doubting
> that you have the right test set to assume that your parser works.
> 
> > the exception and save the bad xml to the buffer and hope the next
> > read() fixes it. This is also a DoS problem, if that stanza never gets
> > fixed it'll keep raising the exception which will keep adding onto the
> > buffer, which will keep raising the exception...

The parsers are fine. However, staying with one parser and keeping your
own state per-stream is wrong. Keep one push parser per stream and let
it care about the stream's state. Then just build the DOM with SAX
events coming in.

As I already told you, this is perfectly doable with both
REXML::Parsers::SAX2Parser and libxml-ruby's XML::Parser, the latter one
in push mode with my recent patch to their list.

I'd be happy to repair your code if you finally shared it.


Stephan
_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
_______________________________________________

Reply via email to