I’m using TouchXML to parse an RSS feed.
It works pretty well until it encounters this element:
<CXMLElement 0x183a10 [0x1bdb80] item <item><title>Wenger faces greatest challenge</title><description>Manager at defining moment in Arsenal career, says Phil McNulty</description><link>http://www.bbc.co.uk/go/rss/-/blogs/philmcnulty/2011/07/arsenal.html</link><guid isPermaLink=\"false\">http://www.bbc.co.uk/blogs/philmcnulty/2011/07/arsenal.html</guid><pubDate>Mon, 04 Jul 2011 12:41:39 GMT</pubDate><category>separator</category><media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/53844000/jpg/_53844595_wenger6649getty.jpg\"/></item>>"
All the tags get parsed out ok using the following code:
[blogItem setObject:[[resultElement childAtIndex:counter] stringValue] forKey:[[resultElement childAtIndex:counter] name]];
Except for the media:thumbnail which this code returns as an empty string @””
[resultElement childAtIndex:counter] stringValue]
So there stringValue part of this code fails to return anything.
If I do an NSLog of
NSLog(@"ResultElement: %@", [resultElement childAtIndex:counter] );
It actually prints out :
ResultElement: <CXMLElement 0x4e1c310 [0x4b22eb0] media:thumbnail <media:thumbnail width="66" height="49" url="http://news.bbcimg.co.uk/media/images/53844000/jpg/_53844595_wenger6649getty.jpg"/>>
At this stage I know if I can get this object into an NSString or something I can use that to parse out the URL which I need.
Something like NSString *aStr = [NSString stringWithObject:[resultElement childAtIndex:counter]];
Or some special trick maybe?
Have any of you the knowledge to share as to how to make this happen?
Kindest Regards,
-Code
Use :