sagarkothari
sagarkothari

Reputation: 24820

How LibXmlParsing can parse in chunks

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    xmlParseChunk(context, (const char *)[data bytes], [data length], 0);
}

my Question is as follows

=> didReceiveData: method receives data in parts

Some what like this

=> How xmlParseChunk() method can parse all these chunks successfully?

Upvotes: 0

Views: 1417

Answers (2)

Ole Begemann
Ole Begemann

Reputation: 135568

Apple's XMLPerformance sample app illustrates a complete implementation of libxml2 integrated with NSURLConnection and chunk parsing. I found it very helpful.

Upvotes: 2

nall
nall

Reputation: 16149

One approach is to have your delegate contain an NSMutableData member and invoke appendData: when you get new data. Then parse it when your delegate gets the connectionDidFinishLoading message.

Upvotes: 0

Related Questions