Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3397684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:33:29+00:00 2026-05-18T04:33:29+00:00

Dear Scholars I am trying to parse a RSS feed with the following item

  • 0

Dear Scholars
I am trying to parse a RSS feed with the following item element structure

<item> 
         <title>Title</title> 
         <link>http://somelink.com</link> 
         <description>The description</description> 
         <author>rss@youtube.com</author> 
         <guid isPermaLink="false">http://youtube.com/?v=XBE4AX0Iuvw</guid> 
         <pubDate>Thu, 11 Nov 2010 10:56:44 +0000</pubDate> 
         <media:title>Media Title</media:title> 
         <media:thumbnail width="120" url="http://i1.ytimg.com/vi/XBE4AX0Iuvw/default.jpg" height="90"/> 
         <media:category label="Tags"/> 
         <media:player url="http://youtube.com/?v=XBE4AX0Iuvw"/> 
         <media:credit>Credit name</media:credit> 
         <enclosure url="http://youtube.com/v/XBE4AX0Iuvw.swf" duration="104" type="application/x-shockwave-flash"/> 
</item> 

Please note the tag media:thumbnail.url of which my question is related to.

Parser code:

// string contants found in the RSS feed
static NSString *kIDStr     = @"link";
static NSString *kNameStr   = @"thumbnail";
static NSString *kImageStr  = @"media:thumbnail";
static NSString *kArtistStr = @"description";
static NSString *kEntryStr  = @"item";


- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
                                            namespaceURI:(NSString *)namespaceURI
                                           qualifiedName:(NSString *)qName
                                              attributes:(NSDictionary *)attributeDict
    {
        // entry: { id (link), im:name (app name), im:image (variable height) }
        //
        NSLog(@"%@",elementName); 
        // I can see all top level elements,even media:thumbnail

        if ([elementName isEqualToString:kEntryStr])
        {
            self.workingEntry = [[[AppRecord alloc] init] autorelease];
        }
        storingCharacterData = [elementsToParse containsObject:elementName];
    }

    - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
                                          namespaceURI:(NSString *)namespaceURI
                                         qualifiedName:(NSString *)qName
    {
        if (self.workingEntry)
        {
            if (storingCharacterData)
            {


        NSString *trimmedString = [workingPropertyString stringByTrimmingCharactersInSet:
                                           [NSCharacterSet whitespaceAndNewlineCharacterSet]];

                [workingPropertyString setString:@""];  // clear the string for next time

                if ([elementName isEqualToString:kIDStr])
                {
                    self.workingEntry.appURLString = trimmedString;
                }
                else if ([elementName isEqualToString:kNameStr])
                {        
                    self.workingEntry.appName = trimmedString;
                }
                else if ([elementName isEqualToString:kImageStr])
                {

NSLog(@"The Content: %@",workingPropertyString); // Comes back empty, I guess due to the fact it has children inside.               


// QUESTION: How do I get the value stored in media:thumbnail   .url  
//NSLog(@">>>>>>>>>>>>> %@ / %@",[elementsToParse objectAtIndex:2],workingPropertyString);



                self.workingEntry.imageURLString = trimmedString;
                }
                else if ([elementName isEqualToString:kArtistStr])
                {
                    self.workingEntry.artist = trimmedString;

                }
            }
            else if ([elementName isEqualToString:kEntryStr])
            {
                [self.workingArray addObject:self.workingEntry];  
                self.workingEntry = nil;
            }
        }

    }

It seems to be a matter of syntax which I am not familiar with, which grabs the value stored in media:thumbnail.url. Can someone be as kind as to assist me in how do do so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:33:30+00:00Added an answer on May 18, 2026 at 4:33 am

    As url is an attribute of the media:thumbnail element, you need to access it via the attributes dictionary in didStartElement:. The foundCharacters: message (which I assume is where you’re accumulating text into workingPropertyString) is only sent for character data between an element’s start and end tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear all,I am now using a webtool http://fiddesktop.cs.northwestern.edu/mmp/scrape?url= to parse a webpage. For example,we
Dear Spring community, What I am trying to implement is the following: I would
Dear all, I have a select query that currently produces the following results: DoctorName
Dear fellow programmers, I am working on my B&B's website www.bordemundo.com and would like
Dear experts, I was trying to align an paragraph to the middle of an
Dear experts, I was trying to dynamically generate DOM elements using JS. I read
Dear Stackoverflowers, I am trying to build a simple web application in ASP.NET where
Dear Folk's i'm using the following code in order to send the bytes of
Dear g++ hackers, I have the following question. When some data of an object
Dear scholars, code gurus. My question is rather simple, I have been searching and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.