title: iphone using NSXML parser how to parse the attributes
body: <p>I want to know how to parse the attributes in below xml file</p>
  
  <pre><code>&lt;ROOT_ELEMENT&gt;&lt;RESPONSE READ_TAG="LEVEL_LIST" RESULT="" TEXT=""/&gt;&lt;USER USER_NAME="newadmin01" TOKEN_ID="0.766003221016982" FULL_NAME="newadmin01, newadmin01"/&gt;&lt;DATETIME UNFORMATTED_TEXT="Aug 10 2011 12:25PM" FORMATTED_TEXT="10 Aug 12:25"/&gt;&lt;BREADCRUMB/&gt;&lt;LEVEL_LIST&gt;&lt;LEVEL ID="4519" NAME="Mega Mart" CHILD_EXISTS="Y" ADD_EDIT_PRIVILEGE="Y"/&gt;&lt;/LEVEL_LIST&gt;&lt;/ROOT_ELEMENT&gt;
  </code></pre>
  
  <p>here it is my parser code</p>
  
  <pre><code>- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
      elemName = [[NSString alloc] initWithString:elementName];
      NSLog(@"element Name = %@", elementName);
  }
  
  - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {   
      if ([elemName isEqualToString:@"RESPONSE"]) {
          if (!currentValueString) {
              currentValueString = [[NSMutableString alloc] initWithCapacity:1024];
          }
          [currentValueString appendString:string];
      }
      else if ([elemName isEqualToString:@"USER"]) {
          if (!currentValueString) {
              currentValueString = [[NSMutableString alloc] initWithCapacity:1024];
          }
          [currentValueString appendString:string];
      }
      if ([elemName isEqualToString:@"DATETIME"]) {
          if (!currentValueString) {
              currentValueString = [[NSMutableString alloc] initWithCapacity:1024];
          }
          [currentValueString appendString:string];
      }
      else if ([elemName isEqualToString:@"BREADCRUMB"]) {
          if (!currentValueString) {
              currentValueString = [[NSMutableString alloc] initWithCapacity:1024];
          }
          [currentValueString appendString:string];
      }
      else if ([elemName isEqualToString:@"LEVEL"]) {
          if (!currentValueString) {
              currentValueString = [[NSMutableString alloc] initWithCapacity:1024];
          }
          [currentValueString appendString:string];
      }
  
  }
  
  - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
      if ([elemName isEqualToString:@"RESPONSE"]) {
          [tableDataArray addObject:currentValueString];
  
          [currentValueString release];
          currentValueString = nil;
  
          [elemName release];
          elemName = nil;
  
      }   
      else if ([elemName isEqualToString:@"USER"]) {
          [tableDataArray addObject:currentValueString];
  
          [currentValueString release];
          currentValueString = nil;
  
          [elemName release];
          elemName = nil;
  
      }   
      else if ([elemName isEqualToString:@"DATETIME"]) {
          [tableDataArray addObject:currentValueString];
  
          [currentValueString release];
          currentValueString = nil;
  
          [elemName release];
          elemName = nil;
  
      }   
      else if ([elemName isEqualToString:@"BREADCRUMB"]) {
          [tableDataArray addObject:currentValueString];
  
          [currentValueString release];
          currentValueString = nil;
  
          [elemName release];
          elemName = nil;
  
      }   
      else if ([elemName isEqualToString:@"LEVEL"]) {
          [tableDataArray addObject:currentValueString];
  
          [currentValueString release];
          currentValueString = nil;
  
          [elemName release];
          elemName = nil;
      }   
  </code></pre>
  
  <p>}</p>