title: IOS: NSMXLParser with multiple node
body: <p>I have a file xml as this:</p>
  
  <pre><code>&lt;data&gt;
      &lt;first&gt;
          &lt;city&gt;
              city
          &lt;/city&gt;
          &lt;people&gt;
              400
          &lt;/people&gt;
      &lt;/first&gt;
      &lt;size&gt;
          &lt;width&gt;
              340
          &lt;/width&gt;
          &lt;height&gt;
              120
          &lt;/height&gt;
      &lt;/size&gt;
      &lt;description&gt;
          &lt;temp&gt;
              sunny
          &lt;/temp&gt;
          &lt;people&gt;
              45
          &lt;/people&gt;
      &lt;/description&gt;
      &lt;description&gt;
          &lt;temp&gt;
              cloudy
          &lt;/temp&gt;
          &lt;people&gt;
                  90
          &lt;/people&gt;
      &lt;/description&gt;
  </code></pre>
  
  <p>I use for parsing this code:</p>
  
  <pre><code>- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{            
  
      currentElement = [elementName copy];
      if ([elementName isEqualToString:@"first"]) {
          firstType = [[NSMutableDictionary alloc] init];
          currentCity = [[NSMutableString alloc] init];
          currentPeople = [[NSMutableString alloc] init];
      }
  
      if ([elementName isEqualToString:@"size"]){
          currentSize = [[NSMutableDictionary alloc] init];
          width = [[NSMutableString alloc]init];
          height = [[NSMutableString alloc]init];
      }
  
      if ([elementName isEqualToString:@"description"]){
          desc1 = [[NSMutableDictionary alloc] init];
          temp1 = [[NSMutableString alloc]init];
          people1 = [[NSMutableString alloc]init];
      }
  
      if ([elementName isEqualToString:@"description"]){
          desc2 = [[NSMutableDictionary alloc] init];
          temp2 = [[NSMutableString alloc]init];
          people2 = [[NSMutableString alloc]init];
      }
  }
  
  - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{     
  
      if ([elementName isEqualToString:@"first"]) {
  
          [firstType setObject:currentType forKey:@"city"];
          [firstType setObject:currentQuery forKey:@"people"];
                  [feed addObject:[firstType copy]];
      }
      if ([elementName isEqualToString:@"size"]){
  
          [currentSize setObject:tempC forKey:@"width"];
          [currentSize setObject:tempF forKey:@"height"];
          [feed addObject:[currentSize copy]];
      }
      if ([elementName isEqualToString:@"description"]){
  
          [desc1 setObject:temp1 forKey:@"temp1"];
          [desc1 setObject:people1 forKey:@"people1"];
          [feed addObject:[desc1 copy]];
      }
  
      if ([elementName isEqualToString:@"description"]){
  
          [desc2 setObject:temp1 forKey:@"temp2"];
          [desc2 setObject:people1 forKey:@"people2"];
          [feed addObject:[desc2 copy]];
      }
  }
  
  - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
      NSLog(@"found");
      if ([currentElement isEqualToString:@"city"]){
          [currentCity appendString:string];
      } 
      else if ([currentElement isEqualToString:@"people"]) {
          [currentPeople appendString:string];
      } 
      else if ([currentElement isEqualToString:@"width"]){
          [width appendString:string];
      }
      else if ([currentElement isEqualToString:@"height"]){
          [height appendString:string];
      }
      else if ([currentElement isEqualToString:@"temp"]){
          [temp1 appendString:string];
      }
      else if ([currentElement isEqualToString:@"temp"]){
          [temp2 appendString:string];
      }
      else if ([currentElement isEqualToString:@"people"]){
          [people1 appendString:string];
      }
      else if ([currentElement isEqualToString:@"people"]){
          [people2 appendString:string];
      }
  
  }
  
  - (void) parserDidEndDocument:(NSXMLParser *)parser {
  
      NSLog(@"feed:%@",feed);
  }
  </code></pre>
  
  <p>the result of nslog is:</p>
  
  <pre><code>feed:(
          {
          city = city;
          people = 4004590;
      },
          {
          width = 340;
          height = 120;
      },
          {
          temp = sunny;
          people = "";
      },
          { ///???? here there is an empty space
      },
          {
          temp = cloudy;
          people = "";
      },
          {
      }
  )
  </code></pre>
  
  <p>Now I don't understand why there is a space between first dictionary of desc 1 and desc2, and I don't know how "people" take the result of people1 and people2 in a single string</p>
  
  <p>Can you help me?</p>