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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:32:08+00:00 2026-05-25T15:32:08+00:00

Lets say that this is my .xmi file to be parsed; <?xml version=1.0 encoding=UTF-8?>

  • 0

Lets say that this is my .xmi file to be parsed;

<?xml version="1.0" encoding="UTF-8"?>
<Albums>
<Album id="1">
<name>Images</name>
<link1>http://galeri.uludagsozluk.com/38/apple_36298.png</link1>
<link2>http://galeri.uludagsozluk.com/38/apple_36298.png</link2>
<link3>http://galeri.uludagsozluk.com/38/apple_36298.png</link3>
<link4>http://galeri.uludagsozluk.com/38/apple_36298.png</link4>
<link5>http://galeri.uludagsozluk.com/38/apple_36298.png</link5>    
</Album>
</Albums>

How can I create a loop to create a mutable string for link1 link2 link3 and so on. I do not want to be limited with the number of links. So loop is certainly required.

This is my nsxmlparser code;

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString
*)elementName    namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary
*)attributeDict{

    currentElement = [elementName copy];

    if ([elementName isEqualToString:@"Album"]) {
        album = [[NSMutableDictionary alloc] init];
        self.currentName = [[NSMutableString alloc] init];
        self.currentURL = [[NSMutableString alloc] init];
    }
     }

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString
*)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{

    if ([elementName isEqualToString:@"Album"]) {
        [album setObject:self.currentName forKey:@"name"];
        [album setObject:self.currentURL forKey:@"link1"];

        [albums addObject:[album copy]];
    } 
     }

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString
*)string{
    if ([currentElement isEqualToString:@"name"]) {
        [self.currentName appendString:string];
    } else if ([currentElement isEqualToString:@"link1"]) {
        [self.currentURL appendString:string];
    }  }

With this parser, I can only parse link1. But I should create a loop for “link%@” and parser should automatically parse all my links as much as I add.

Or do you guys suggest a better way to parse multiple links under a certain element? A better way to arrange .xml file? I am open to new ideas. like:

<?xml version="1.0" encoding="UTF-8"?>
<Albums>
<Album id="1">
<name>Images</name>
<link id="1">http://galeri.uludagsozluk.com/38/apple_36298.png</link>
<link id="2">http://galeri.uludagsozluk.com/38/apple_36298.png</link>
<link id="3">http://galeri.uludagsozluk.com/38/apple_36298.png</link>
<link id="4">http://galeri.uludagsozluk.com/38/apple_36298.png</link>
<link id="5">http://galeri.uludagsozluk.com/38/apple_36298.png</link>    
</Album>
</Albums>

Or, above xml is possible?

Thanx in advance.

  • 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-25T15:32:08+00:00Added an answer on May 25, 2026 at 3:32 pm

    Best solution I found is to componentseparatedbystring method. If one adds all of links into only one element, parser will parse it as nsstring and you can create nsarray from nsstring. And very easily, we can use this array wherever we want.

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

Sidebar

Related Questions

lets say that I've got this XML: <items> <item name=thumb> <downloadStream>test1</downloadStream> <downloadStream>test2</downloadStream> <downloadStream>test3</downloadStream> </item>
Let's say that I've got this xml: <items> <item name=thumb> <downloadStream>test1</downloadStream> <downloadStream>test2</downloadStream> <downloadStream>test3</downloadStream> </item>
Lets say I have one table called REVIEWS This table has Reviews that customers
Lets say that I have this code $(document).ready(function() { $(#changeText).click(function() { $(#textBox).html(My<br><br><br>text<br><br><br>is<br><br><br>changed!); }); });
This is a conceptual question involving Hadoop/HDFS. Lets say you have a file containing
Lets say that in this case i have 4 divs called .CountThese and i
Lets say that i have this block of text public function __construct() { parent::__construct();
Lets say that I have this code: <div id=gameFrame> <div id=figure></div> </div> Where the
Lets say that I have a HTML that looks like this: <div class=aaa><span>1</span></div> <div
Lets say that I have a function todo() and I want to implement this

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.