I am new to iphone development .I want parse an image url from a xml file and display it in a RSS feed.There are three image url but i want to retrieve only one url and display it.
<entry>
<id>xxxxx</id>
<title>xxx xxxx xxxx</title>
<content>xxxxxxxxxxx</content>
<media:group>
<media:thumbnail url="http://tiger.jpg"/>
<media:thumbnail url="http://lion.jpg"/>
<media:thumbnail url="http://elephan.jpg"/>
</media:group>
</entry>
<entry>
<id>xxxxx</id>
<title>xxx xxxx xxxx</title>
<content>xxxxxxxxxxx</content>
<media:group>
<media:thumbnail url="http://parrot.jpg"/>
<media:thumbnail url="http://peacock.jpg"/>
<media:thumbnail url="http://sparrow.jpg"/>
</media:group>
</entry>
for parsing it
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes: (NSDictionary *)attributeDict{
currentElement = [elementName copy];
if ([elementName isEqualToString:@"entry"]) {
entry = [[NSMutableDictionary alloc] init];
currentTitle = [[NSMutableString alloc] init];
currentDate = [[NSMutableString alloc] init];
NSLog(@"inside image1 ");
}else if([elementName isEqualToString:@"media:thumbnail"])
{
if(myUrl==nil){
NSString* myUrl = [NSString stringWithString:[attributeDict objectForKey:@"url"]];
}
}
}.
I want to retrieve only tiger and parrot image.But i get tiger twice.Please help me out.Thanks.