views:

149

answers:

1

Hi all, How do you get "MayurS123" from following xml tag by parsing?

<eletitle lnk="http://192.168.10.2/justmeans/trunk/newsfeed/mayurs"&gt;MayurS123 Sharma</eletitle>

My file is getting parsed properly. Here I'm able to retrieve the lnk component by doing:

if([elementName isEqualToString:@"eletitle"])
{
        aGoodwork.lnk = [attributeDict objectForKey:@"lnk"];
}

But I'm not getting how to get in actual title.

Thanx in advance.

+3  A: 

You have to implement this delegate method:

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string

Look at any of the XML parsing examples Apple provides with the iPhone SDK and you'll find appropriate code samples.

Ole Begemann
And remember, this method may called several times, so you have to collect the found characters and save them in "didEndElement"
Tim Büthe