I have been trying to do XML parsing in iOS. But I was not able to parse it unfortunately.
Can you help me with this. I was using a SAX parser using NSXML.
The data is
<category>
<cat id="info" name="id1" value="val1" />
<cat id="info" name="id2" value="val2" />
</category>
How do i get the values using SAX parser? Any help would be appreciated.
Thanks
Answer-
(To get the attributes) I used it this way (attributedict is the NSDictionary object in didStartElement method)
NSString *attr = [attributeDict valueForKey:@"name"];
if([attr isEqualToString:@"id1"])
{
NSLog("%@", [attributeDict valueForKey:@"value"]);
}