I have checked lots of tutorials on xml parsing in iOS ..
but most of them have already set the xml response from the server in a clear understandable line by line format
<?xml version="1.0" encoding="utf-8"?>
<people> <person>
<firstName>James</firstName> <lastName>Franklin</lastName>
</person>
<person>
<firstName>Snidely</firstName>
<lastName>Wilsonn</lastName>
</person>
<person>
<firstName>Dudley</firstName>
<lastName>Doright</lastName>
</person> </people>
Now seeing this.. it is pretty easy to follow what tags you have to filter and extract data from ..
But now when i am doing this . (like this in my app)
NSError *error;
NSData *linkData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"someURL"] options:NSDataReadingUncached error:&error]
NSString *stringData = [[NSString alloc]initWithData:linkData encoding:NSUTF8StringEncoding];
NSLog(@" Data /n/n/n %@",stringData);
It is coming like this in console :
Data /n/n/n {"entries":[{"id":"37504814","title":"Live Blog: Patrik Schumacher","created":"2012-02-09 23:43:00","updated":"2012-02-10 03:34:05","user_id":"15084","entry_type":"20","location":null,"portfolio_id":null,"arc_name":"Lian Chikako Chang","parent_image":"xyz2sb7y9n4mtvbb.jpg","link":"http:live-blog-patrik-schumacher","quote":null,"content":" \n<p>\n\tHi Archinect!<\/p>\n<p>\n\tPatrik Schumacher, partner at Zaha Hadid Architects and founding director at the AA Design Research Lab, is in Piper tonight for a lecture on \"Parametric Order: 21st century architectural order.\"<\/p>\n<p>\n\t<img alt=\"\" src=\"http
NOw this is JSON and XML both .. but there are thousands of lines more after it /…and i am not able to understand it as it is…any way to get it in the proper formatted format like the above given XML.??
ALSO one more question : Is the XML parser best for parsing or should i do it with other projects for xml parsing on github?.
Thanks
this will format xml the xml for you to make it more readable.
http://xmltoolbox.appspot.com/