It sounds like you're trying to take the incoming XML stream as-is and separate 
it into stanzas without properly parsing the XML. You will need to parse the 
XML anyway to make use of it, so you may as well do it as it comes in.

Buffer the incoming raw data, and then parse XML components, and complete 
stanzas out of that - then you can create Stanza objects and put them into a 
queue ready for handling. A complete stanza is any opening presence/message/iq 
up to and including its closing tag. On rare occasions you will find you only 
have half a stanza in your buffer, so you'll need to be able to continue its 
parsing once more data is received.

Most implementations use an XML parsing library, so they build a tree/structure 
from its output.

_______________________________________________
Standards mailing list
Info: https://mail.jabber.org/mailman/listinfo/standards
Unsubscribe: [email protected]
_______________________________________________

Reply via email to