NSxml parser upto 3 levels on iphone
<p>i have a issue  getting the value of A->1,2,3,4 &amp; b->1,2,3,4 </p>

<p>i have to show these data on 3 tables</p>

<p>table 1) A , B
table 2)when user click on A -> he can see 1,2,3,4 in tablular form 
but i my case  i can only show the last value of A  i.e 4 ( not 1,2,3)</p>

<p>how to parse all 1,2,3,4 </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;hall&gt;
&lt;movie Name="A"&gt;
&lt;stall Name="1"&gt;
&lt;description&gt;qwe.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;stall Name="2"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;stall Name="3"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;stall Name="4i"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;/movie &gt;
&lt;movie Name="B"&gt;
&lt;stall Name="t1"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;stall Name="2"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;stall Name="3"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;stall Name="4"&gt;
&lt;description&gt;wer.&lt;/description&gt;
&lt;rating&gt;5&lt;/rating&gt;
&lt;/stall&gt;
&lt;/movie&gt;
&lt;/hall&gt;
</code></pre>

#

<p>UPDATES</p>

#

<p><strong>my problem is i dont know how to separate Movie name A and B data</strong></p>

<pre><code>- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName 
    attributes:(NSDictionary *)attributeDict {

    if([elementName isEqualToString:@"hall"])
    {
        movieList = [[NSMutableDictionary alloc]init];
            appDelegate.books = [[NSMutableArray alloc]init];
        appDelegate.HospN = [[NSMutableArray alloc]init];
    }
    else if([elementName isEqualToString:@"movie"])
    {
        currentMovie = [[NSString alloc] initWithString:[attributeDict objectForKey:@"Name"]] ;
        [appDelegate.books addObject:[attributeDict objectForKey:@"Name"]];


        //[aBook.movie addObject:[attributeDict objectForKey:@"Name"]];
        NSLog(@"Processing Value: %@", currentMovie);
        //aBook.testament=currentMovie;

        aBook.stall = [attributeDict  objectForKey:@"name"];

        NSLog(@"Movie A name : %@",[movieList objectForKey:@"A"]);


    }
    else if([elementName isEqualToString:@"stall"])
    {
        [appDelegate.HospN addObject:[attributeDict objectForKey:@"Name"]];
        NSLog(@"Processing stall Value: %@", currentElementValue);

        NSLog(@"appDelegate.HospN: %@", appDelegate.HospN);

    }

}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { 

    if(!currentElementValue) 
        currentElementValue = [[NSMutableString alloc] initWithString:string];
    else
        [currentElementValue appendString:string];

    //NSLog(@"Processing Value: %@", currentElementValue);

}

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

    if([elementName isEqualToString:@"hall"])
    {
        //NSLog(@"Movie List : %@",movieList);
    }
    else if([elementName isEqualToString:@"movie"])
    {
        [movieList setObject:appDelegate.books forKey:currentMovie];


        NSLog(@"Movie name : %@",appDelegate.books );



        NSLog(@"Movie A name : %@",[movieList objectForKey:@"A"]);
        [currentMovie release];
        //[stallNames release];
        currentMovie = nil;
        //stallNames = nil;
    }
    else if([elementName isEqualToString:@"stall"])
    {
        //you can populate other attributes here if stall is not just string but a modal class.
    }

    else 

        [aBook setValue:currentElementValue forKey:elementName];

    [currentElementValue release];
    currentElementValue = nil;
}
</code></pre>

<p>my array  my appDelegate.HospN: value is  (
        1,
        2,
        3,
        4i,
        t1,
        2,
        3,
        4
    )
**but i want to chop data at A= 1,2,3,4i</p>

<p>and B= t1,2,3,4**</p>

<h1>Updtate</h1>

<p>how to get the value of description and rating ??</p>

<pre><code>else if([elementName isEqualToString:@"description"])
        { 
            NSLog(@"desp List : \n%@\n",currentElementValue);// i can see all value but how to chop data based on A and B


            [movieList setObject:currentLink forKey:@"description"];
            [appDelegate.despArray addObject:[movieList copy]];


            NSLog(@"adding story: %@",currentLink);

        }



    else if([elementName isEqualToString:@"rating"])
        {



        }
</code></pre>
