Hello On Wed, Oct 01, 2008 at 11:04:11AM -0400, Eric Will wrote: > On Wed, Oct 1, 2008 at 8:21 AM, Michal 'vorner' Vaner <[EMAIL PROTECTED]> > wrote: > > You can not use a new parser every time. You need it to know the > > beginning of the stream. > > Why? It works fine without knowing it. How can I reuse the same parser > when the source changes?
If you take <stream thenamespace etc><first stanza/> and put it into
first parser and then <second stanza/><third stanza> to second and
</thind stanza> into another, then you get mess and not data. Or do you
reuse it in some other way I do not get?
When a stanza gets split into two chunks, you get even more mess.
> That is, I have to do parser = REXML::Parsers::SAX2Parser.new(source)
> every time, and feed it the source. Is there a way to feed an existing
> SAX2Parser a new source?
This is my code when data come. It is C++ and Qt, but you might see:
source.setData( text );
reader.parseContinue();
--
"Don't worry about people stealing your ideas. If your ideas are any good,
you'll have to ram them down people's throats."
-- Howard Aiken
Michal 'vorner' Vaner
pgpdX9p8fdyFd.pgp
Description: PGP signature
_______________________________________________ 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] _______________________________________________
