views:

644

answers:

2

Programming for iPhone. Title says it all.

When parsing with NSXMLParser, does it download the whole .xml then parse, or does it do a "streaming" parse? Essentially if I abort the parse halfway through, do I save bandwidth, or just cpu cycles?

+1  A: 

NSXMLParser is a streaming parser in the sense that it generates a stream of events that clients can use to process the data, it does not accept streaming input. The underlying libxml2 library it is based does accept streaming input, and there are several NSXMLParser clones and subclasses that provide that sort of functionality, such as this.

Louis Gerbarg
+3  A: 

NSXMLParser downloads then parses. If you want to parse while downloading, you should look at the XMLPerformance sample project from Apple and implement a libxml based parser.

Carl Coryell-Martin