Parsing a complex XML string (RXML)

tolyka

New Member
This is my simplified XML string:\[code\]<rss> <channel> <item> <title>ITEM TITLE</title> <description> <i>Att1 </i>10, <i>Att2 </i>20, <i>Att3 </i>30 </description> </item> </channel></rss>\[/code\]With this RXML code I can parse the ENTIRE < description> tag:\[code\]RXMLElement *rxmlRoot = [RXMLElement elementFromURL:[NSURL URLWithString:@"MY_XML_URL]]; RXMLElement *firstLevel = [rxmlRoot child:@"channel"]; NSArray *secondLevel = [firstLevel children:@"item"]; [rxmlRoot iterateElements:secondLevel usingBlock:^(RXMLElement *appElement) { NSString *description = [appElement child:@"description"].text;\[/code\]And its perfect! The parsed *description string is: "< i>Att1< /i> 10, < i>Att2< /i> 20, < i>Att3< /i> 30"But I want to parse the separate values of Att1, Att2 and Att3; I need to extrapolate the single value of 10, 20 and 30, unluckly in the same tag. Its possible? There is a way to do it with RXML, or another xml parser for XCode? Thanks!
 
Back
Top