Finutv
Finutv

Reputation: 341

how to parse online from server?

I am new to iphone programing. I used to load the whole xml content from url to NSData and then parse it using nsxmlparser. Is there any way parsing it faster. I would like to know if i can parse it online not load it into memory then parse. or any efficient way?

Thanks

Upvotes: 1

Views: 108

Answers (3)

Anil Kothari
Anil Kothari

Reputation: 7733

you can use this link. It will show you the performance of each of the parser that exist in iphone/ipad environment. According to your need use it.

http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project

Upvotes: 0

krammer
krammer

Reputation: 2658

You can convert your xml to a JSON i.e. with Key-Value pairs. You can then parse the JSON at the client end to do the rest.

JSON is much lighter than XML and hence lets you pass much less data on the network.

To parse JSON in objective c you can use json framework.

Also, you can parse the entire xml at server and pass a file with key-value pairs (as a dictionary). It may seem to be one of the options but the exact applicability would depend upon your requirements and infrastructure.

Upvotes: 2

Ilanchezhian
Ilanchezhian

Reputation: 17478

libxml2 is faster than NSXMLParser. You can found that from here.

A simple tutorial can be found at this link.

Upvotes: 2

Related Questions