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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:18:59+00:00 2026-05-28T01:18:59+00:00

how to parse 2 URL’s using NSXMLParser in the same file? I have tried

  • 0

how to parse 2 URL’s using NSXMLParser in the same file? I have tried it like this:

[self parseXMLFileAtURL:url1];
[self parseXMLFileAtURL:url2];

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{    
    //here both url's returns the same data (element names are same), so how will I differentiate data between first URL & second URL.

    if(url1 data) { 
        //do something
    }
    if(url2 data) { 
        //do something
    }
}

so help me to find a way to differentiate.

  • 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-28T01:19:00+00:00Added an answer on May 28, 2026 at 1:19 am

    The first parameter called parser is the current parser instance used.
    This is the way to know which file you are currently parsing.

    Alloc/init two separate instances of NSXMLParser, and start parsing your two files with.
    Assuming they are ivar a simple == test would tell you which one is used.

    Here is a link to similar question.

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

Sidebar

Related Questions

I have got a url like this - http://www.facebook.com/profile.php?id=1820816888 Now i want to get
Possible Duplicate: extract last part of a url I have a url like this:
If I have a url that looks like this, what's the best way to
I have this code to parse url string such as ?var=val but when search
Using Paperclip, I want to grab an image from a URL like this: require
I'd like to parse an incoming URL into it's component parts for some pre-processing
I have this database table: id | url ----------------------------------------- 1 | http://stackoverflow.com/ 2 |
I 'm opening a video file (3gp) file using code below String url =
the url : http://www.evemarketeer.com/api/orders/10000043/30119/xml I tried this DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db =
Possible Duplicate: What's the simplest way to parse URL parameters in Clojure? I'd like

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.