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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:51:24+00:00 2026-05-23T08:51:24+00:00

any body know how to parse a dynamic xml. I have an XML with

  • 0

any body know how to parse a dynamic xml. I have an XML with some tags. here is a tag videos like:

<Videos>
   <video>"Video link"</Video>
</Videos>

now in this XML, tags in <Videos> can be changed they could be <video> or <image> or <clip> or any thing else. So is it possible to parse that XML? how can i detect that tag what is the name of tag or what is in this tag?

  • 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-23T08:51:25+00:00Added an answer on May 23, 2026 at 8:51 am

    I use touch xml to solve this issue

    I am using in

    NSError * theError=nil;

        NSMutableArray *res = [[NSMutableArray alloc] init];
    
    
    NSString *XMLPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"sample.xml"];
    
    NSData *XMLData   = [NSData dataWithContentsOfFile:XMLPath];
    
    CXMLDocument *doc = [[[CXMLDocument alloc] initWithData:XMLData options:0 error:nil] autorelease];
    
    
    
    NSArray *nodes = NULL;
    
    
    
    nodes = [doc nodesForXPath:@"//sample" error:nil];
    
    
    
    for (CXMLElement *node in nodes) {
    
        NSMutableDictionary *item = [[NSMutableDictionary alloc] init];
    
        int counter;
    
        for(counter = 0; counter < [node childCount]; counter++) {
    
            //  common procedure: dictionary with keys/values from XML node
    
            NSString * a=[NSString stringWithFormat:@"%@%d",[[node childAtIndex:counter] name],counter+1];
    
            [item setObject:[[node childAtIndex:counter] stringValue] forKey:a];
    
        }
    
    
        //NSLog(@"%)
        //  and here it is - attributeForName! Simple as that.
    
        [item setObject:[[node attributeForName:@"id"] stringValue] forKey:@"id"];  // <------ this magical arrow is pointing to the area of interest
    
    
    
        [res addObject:item];
    
        [item release];
    
    }
    
    
    
    //  and we print our results
    
    NSLog(@"%@", res);
    
    [res release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody know what my DLLImport statement should look like here: extern C __declspec(dllexport) long
Now that I know how to parse xml in scala as a stream I
anybody know how can i parse a csv or xml document with multiple addresses,
Anybody know of snippet that will parse a CSS3 selector like this: form#network_template[method='put'][action='#form_{keyname}'] to
Does anybody know any good resources for learning how to program CIL with in-depth
Does anybody know of any sample databases I could download, preferably in CSV or
I am using expat parser to parse an XML file of around 15 GB
Here's the issue: I have a hook in IE that reacts on WebBrowser.OnNavigateComplete2 event
Does anybody know how can I parse a google.gdata.calendar.TimeZoneProperty to a java.util.TimeZone ?. Thanks
I have this string containing a date I need to parse to get a

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.