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 9061097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:23:59+00:00 2026-06-16T15:23:59+00:00

Im trying to parse a xml feed in my app… The xml file is

  • 0

Im trying to parse a xml feed in my app… The xml file is in this url

feeds.feedburner.com/blogspot/TUvAW?format=xml

The problem is that when I access the description segment it diplays different special symbols such as quotation marks. This is one of the descripton segments im trying to parse from my xml:

<description>Este es mi blog 3&lt;img src="http://feeds.feedburner.com/~r/blogspot/TUvAW/~4/URCV9ModTR0" height="1" width="1"/&gt;</description>

Im parsing it with the NSXMLParser, these are the method I’m using in my:

XMLParser.m

- (void) parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
    currentNodeContent = (NSMutableString *) [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}

- (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
{
    if ([elementname isEqualToString:@"item"])
    {
        currentFeed = [Feed alloc];
        isStatus = YES;
    }
    if ([elementname isEqualToString:@"author"])
    {
        isStatus = NO;
    }
}

- (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
    if (isStatus)
    {
        if ([elementname isEqualToString:@"description"])
        {
            currentFeed.description = currentNodeContent;
            NSLog(@"%@",currentNodeContent);

        }
        if ([elementname isEqualToString:@"title"])
        {
            currentFeed.content = currentNodeContent;
            NSLog(@"%@",currentNodeContent);

        }
        if ([elementname isEqualToString:@"link"])
        {
            currentFeed.WVUrl = currentNodeContent;
            NSLog(@"%@",currentNodeContent);
        }
    }
    if ([elementname isEqualToString:@"item"])
    {
        [self.feeds addObject:currentFeed];
        currentFeed = nil;
        currentNodeContent = nil;
    }
}

Im using those NSLogs to track the strings that Im getting from the parse but my description node content is always showing just this : >
The title and link nodes are displaying perfectly.

I want to get all that string from the description node to use it later but simply I can’t, I dont know whats going wrong with this.

  • 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-06-16T15:24:01+00:00Added an answer on June 16, 2026 at 3:24 pm

    The problems have been outlined by Abhishek, Rob and me. But I think it’s worth to summarize it and show the correct solution.

    The main problem is that parser:foundCharacters: is called several times for the <description> tag, each call providing a piece of the description.

    The solution is to concatenate the pieces:

    XMLParser.h:

    NSMutableString* currentNodeContent;
    

    XMLParser.m:

    - (void) parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
    {
        if (currentNodeContent == nil)
            currentNodeContent = [[NSMutableString alloc] initWithCapacity: 20];
        [currentNodeContent appendString: [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];
    }
    
    - (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
    {
        if ([elementname isEqualToString:@"item"])
        {
            currentFeed = [Feed alloc];
            isStatus = YES;
        }
        if ([elementname isEqualToString:@"author"])
        {
            isStatus = NO;
        }
    }
    
    - (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
    {
        if (isStatus)
        {
            if ([elementname isEqualToString:@"description"])
            {
                currentTweet.description = currentNodeContent;
                NSLog(@"%@",currentNodeContent);
    
            }
            if ([elementname isEqualToString:@"title"])
            {
                currentTweet.content = currentNodeContent;
                NSLog(@"%@",currentNodeContent);
    
            }
            if ([elementname isEqualToString:@"link"])
            {
                currentFeed.WVUrl = currentNodeContent;
                NSLog(@"%@",currentNodeContent);
            }
        }
        if ([elementname isEqualToString:@"item"])
        {
            [self.feeds addObject:currentFeed];
            currentFeed = nil;
            [currentNodeContent release];
            currentNodeContent = nil;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xml feed at this url Now im trying parse the content,
I was trying to parse an xml file. My problem is same as this:
Trying to parse out this xml file to get a list of Elements but
I'm trying to parse an RSS feed using LINQ to Xml This is the
Im trying to parse a Xml file from a URL, the xml is actually
I am trying to parse this xml feed [0] => SimpleXMLElement Object ( [title]
I'm trying to parse XML file (RSS Feed), but I have a problem that
Since Days i'm trying to parse a YOUTUBE-XML-Feed by using GDATA-API for iOS. http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_protocol_channel_search.html
I am trying to parse this XML Yahoo feed . How do i like
I am trying to parse this xml (http://www.reddit.com/r/videos/top/.rss) and am having troubles doing so.

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.