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

  • Home
  • SEARCH
  • 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 4532332
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:01:04+00:00 2026-05-21T14:01:04+00:00

I have some problems with parsing of xml in my iPhone Application. Here is

  • 0

I have some problems with parsing of xml in my iPhone Application. Here is some part of xml code that I want to parse with standard NSXMLParser parser.

<item>
<title>AMNews: Facebook & Twitter Updates Might Lead To Burglary, Oldham School Violates DPA, Amazon Cloud “Burstsâ€</title>
<link>http://www.itproportal.com/2011/04/22/amnews-facebook-twitter-updates-might-lead-to-burglary-oldham-school-violates-dpa-amazon-cloud-bursts/</link>
<description>People announcing their holiday plans on social networking platforms like Facebook and Twitter are putting themselves at risks from thieves and burglars. A new study ha</description>
<author>ravimandalia@itproportal.com (Ravi Mandalia)</author>
<pubDate>Fri, 22 Apr 2011 08:19:36 +0100</pubDate>
<guid>http://cdn.itproportal.com/photos/facebook-logo-4_thumb80x80.png</guid>
</item>

How you can see in

<title>AMNews: Facebook & Twitter Updates Might Lead To Burglary, Oldham School Violates DPA, Amazon Cloud “Burstsâ€</title>

title tag some strange symbols appear ““” “â“. In function

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string;

I am trying to get title and save it, but my parser works wrong. Parser take only text after ““” symbol !!!

What can I do and can anybody tell me what happens with parse ? Thanks a lot !!!

  • 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-21T14:01:04+00:00Added an answer on May 21, 2026 at 2:01 pm

    Here is implementation of -parser:foundCharacters:

    - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
        //in case of unusable tags
        if (currentArticle == nil) {
            return;
        }
        // Get Title.   
        if ([currentElement isEqualToString:@"title"]) {
            [self.currentArticle setTheTitle:string];
        // Get Description.
        } else if ([currentElement isEqualToString:@"description"]) {
            string = [string stringByReplacingOccurrencesOfString: @"\n" withString: @"" ];
            [self.currentArticle setTheSummary:string];
    
        } else if ([currentElement isEqualToString:@"link"]) {
            [self.currentArticle setTheMainLink:string];
    
        } else if([currentElement isEqualToString:@"guid"]){
            [self.currentArticle setTheImageLink:string];
    
        } else if ([currentElement isEqualToString:@"pubDate"]) {
            [self.currentArticle setThePubDate:string];
    
        } else if([currentElement isEqualToString:@"author"]){
            [self.currentArticle  setTheAuthor:string];
        }
    }
    

    I have notice that parser get title two times at first time from the begin to the “ and second time from “ to end. Like in my feed there are two title tags.

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

Sidebar

Related Questions

So I have some perl code that goes something like: use strict; use XML::XPath;
I have been doing some XML parsing in my application. I used the following
I have to parse xml file and after parsing I have to out related
I have some problems with UITableView and sections/rows. Iam parsing the section names, all
I am new to iPhone/Objective-C development, I am successfully parsing XML with NSXMLParser but
I have some XML that has creating using an XmlDocument object in C#. I
I have some code which fetches an XML file from a URL and then
I'm developing an application on the Android system which involves parsing some xml stuff.
I have an iOS app that is calling a web service for some XML
I am using SAX to parse some large XML files and I want to

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.