title: Not able to get data using NSXmlParser
body: <p>I am using <code>NSXmlParser</code> to get data from <code>XML</code>. In the parser delegate method I have:</p>
  
  <pre><code>- (void)resetPassCallback: (NSData*) data{
          NSLog(@"start parsing the data");
          NSXMLParser *nsXmlParser = [[NSXMLParser alloc] initWithData:data];
          [nsXmlParser setDelegate:self]; 
          BOOL success = [nsXmlParser parse];
          if (success) {
               NSLog(@"No errors %@", xmlArray);
          } else {
               NSLog(@"Error parsing document!");
          }
  }
  
  - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qualifiedName attributes: (NSDictionary *)attributeDict
  {
        element = elementName;
        if([elementName isEqualToString:@"User"])
        {
        XmlDict = [[NSMutableDictionary alloc]init];
        userId =[[NSMutableString alloc]init];
        screenName =[[NSMutableString alloc]init];
        xmlArray = [[NSMutableArray alloc]init];
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
      NSLog(@"foundCharacters ::::: %@ :::: ", string);
     [xmlArray addObject:string];
  }
  </code></pre>
  
  <p>Although I am able to parse the data, I am not getting the complete data. In the console, the log shows: </p>
  
  <pre><code>foundCharacters ::::: 200 :::: 
  foundCharacters ::::: f1f47453-04d7-20c8-a9e1-406fdc89a2da :::: 
  foundCharacters ::::: test :::: 
  foundCharacters ::::: 62e2092a-eb6e-44ad-7a7b-3deb976569c1 :::: 
  foundCharacters ::::: Thomas :::: 
  xmlArray contents : (
  "62e2092a-eb6e-44ad-7a7b-3deb976569c1",
  Thomas
  )
  </code></pre>
  
  <p>As you can see, why am I not getting the “test” and other values in the <code>xmlArray</code>. </p>