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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:12:46+00:00 2026-06-16T07:12:46+00:00

Possible Duplicate: Xml parsing in iOS tutorial I have XML file in my Xcode

  • 0

Possible Duplicate:
Xml parsing in iOS tutorial

I have XML file in my Xcode project and I want to parse this XML file and show data in UITableView. Since I am new to xml parsing it’s getting difficult for me to do the same. How to parse the below xml?

My xml file is:

<application>
    <app_data>
        <wayHome>
            <data>
                <title>159 Darby St Bus Stop</title>
                <category>BUS</category>
                <lat>-32.9320366</lat>
                <long>151.7712731</long>
                <image>159 Darby St Bus Stop.png</image>
            </data>
            <data>
                <title>Beaumont St and Denison St Taxi Rank</title>
                <category>TRAIN</category>
                <lat>-32.9320366</lat>
                <long>151.7712731</long>
                <image>Beaumont St and Denison St Taxi Rank.png</image>
            </data>
            <data>
                <title>Beaumont St Bus Shop next to ANZ</title>
                <category>BUS</category>
                <lat>-32.9227304</lat>
                <long>151.7472369</long>
                <image>Beaumont St Bus Shop next to ANZ.png</image>
            </data>
         </wayHome>
     </app_data>
</application>
  • 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-16T07:12:48+00:00Added an answer on June 16, 2026 at 7:12 am

    Use NSXMLParserDelegate Methods to parse the File.

    In yourInterface.h file include NSXMLParserDelegate 
    
    @implementation yourInterface.m file: use below code
    
    NSURL* xmlFile = [NSURL  fileURLWithPath:[[NSBundle mainBundle]
                                               pathForResource:@"yourXMLfile"
                                               ofType:@"xml"]];
    
    NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:xmlFile];
    
    //Initialize the delegate.
    XMLParser *parser = [[XMLParser alloc] initXMLParser];
    
    //Set delegate
    [xmlParser setDelegate:parser];
    
    //Start parsing the XML file.
    BOOL success = [xmlParser parse];
    
    if(success)
    NSLog(@"No Errors");
    else
    NSLog(@"Error Error Error!!!");
    

    Use Delegate Methods to parse The File.
    I assume that you need to parse the “Data” tags.
    Here, you can check that ElementName is “Data” OR NOT. And similar for the innertags of “Data”. Here you can maintain Array OR Dictionary For Data Elements.

    so your work is to do in Delegate methods:

    - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict;
    
    - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string;
    
    - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Parsing XML data to NSMutableArray iOS - iPhone <ForecastResult> <Forecast> <Date>2012-06-27T00:00:00</Date> <WeatherID>4</WeatherID>
Possible Duplicate: Parsing XML in Cocoa iPhone - Can we parse .plist(xml) file using
Possible Duplicate: How to parse and process HTML/XML with PHP? I want to grab
Possible Duplicate: Creating a simple XML file using python I want to write a
Possible Duplicate: Best practices to parse xml files? I have a xml string: <XML>
Possible Duplicate: Parsing an UTF-8 Encodded XML file I am parsing a UTF-8 Encoded
Possible Duplicate: Converting string into datetime I am parsing an XML file that gives
Possible Duplicate: Android XML Percent Symbol hi mate i have an array in file
Possible Duplicate: Parse XML Elements with LINQ I have an XML document that looks
Possible Duplicate: how to read a xml file using java? I want to the

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.