My iPhone App is socket based and receives a continuous, non-delimited stream of XML documents one after the other in which I intend to parse with the event-based NSXMLParser.
Example: 2 documents one after the other
<?xml version='1.0' encoding='UTF-8' ?><document name="something"><foo>bar</foo></document><?xml version='1.0' encoding='UTF-8' ?><document name="somethingelse"><bar>foo</bar></document>
In the Java-based implementation of this, the XML parser simply parses a stream until it reaches the end of the document, at which point it does its thing and then starts parsing the next document from that point in the stream.
The problem is NSXMLParser does not accept a stream and does not tell me at what point in the NSData it finished parsing (except for a useless line and column number).
I have seen some solutions like the AQ StreamingXMLParser but again, when this gets to the end of the document it just stops and wont attempt to parse another document, or tell me exactly where in the stream it finished so that I can start a new parse.