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

Hey any body know how to hide cell contains using spreadsheet gear.
Does any body know how can I use MS_MPI in my VC++ MFC project?
Now that I know how to parse xml in scala as a stream I
I have some XML files of this form: <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=biomirror.xsl?>
Does anybody know of a python module to parse a doxygen style C++ comment
Does anybody know a Java MIDI parser that will parse a MIDI into a
Anybody know of a way to batch NHibernate queries using NHibernate.Linq like you can
Anybody know of a good 3rd Party grid control that supports AutoFill (like Excel
Anybody know where is the source of ninject compact framework? Any version is acceptable
trying to access various properties of my video tag. started looking at the HTML5

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.