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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:18:32+00:00 2026-05-23T06:18:32+00:00

I have an xml file with some rows like this: <Country ID= Name=Italy />

  • 0

I have an xml file with some rows like this:

  <Country ID="" Name="Italy" />
  <City ID="" Name="Rome" />
  <Place ID="" Name="Colosseum">

but when I parse it the element Country or City or Place are empty (line break)

My code is:

    - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
        if ([currentElement isEqual:@"Country"]) {
             NSLog(@"Country %@", string);
        }
    }

Any help is appreciated.

Thanks,
Max

  • 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-23T06:18:32+00:00Added an answer on May 23, 2026 at 6:18 am

    The values you see in your xml are the element attributes, not element data. So it wont show up in ‘foundCharacters’ method.
    You will have to fetch the attribute values from the attributes dictionary in ‘didStartElement’ method:

    - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
    {
        if ([currentElement isEqual:@"Country"]) {
             NSLog(@"Country %@", [attributeDict objectForKey:@"Name"]);
        }
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some values in a configuration file (XML file) with some values like
I have an XML file that I would like to map some attributes of
I have an XML Template file. This file contains a header and some predefined
I have to find some patters from a XML file, but i am unable
I have an xml file with some placeholder if you like.I need to read
lets say i have an xml file path.xml that goes like this: <paths> <path
i have an xml file which contain some data like: <?xml version=1.0 encoding=utf-8 ?>
I have a XML file containing some elements like <root> <gp> <i>1</i> <i>3</i> <i>5</i>
I have an XML file from which I am parsing some content to display
I have an XML file that I'm trying to serialize into an object. Some

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.