Parsing method was not called in NSXML parser
<p>I was using NSXML parser for parsing but it was not calling the parser delegate methods, its shows zero error but i don't know where i made a mistake. and i need to parse attribute contents also.</p>

<p>Thanks in advance</p>

<p>Here is my xml file and code  </p>

<p>**1.  </p>

<ul>
<li>xml file</li>
</ul>

<p>*<code>* &lt;ROOT_ELEMENT&gt;&lt;RESPONSE READ_TAG="LEVEL_LIST" RESULT="" TEXT=""/&gt;&lt;USER USER_NAME="newadmin01" TOKEN_ID="0.6864221651800831" FULL_NAME="newadmin01, newadmin01"/&gt;&lt;DATETIME UNFORMATTED_TEXT="Aug 10 2011  5:23PM" FORMATTED_TEXT="10 Aug 17:23"/&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></p>

<p>**2. </p>

<ul>
<li>.h file</li>
</ul>

<p>**  </p>

<pre><code>@interface MainLevelList : UIViewController 
&lt;UITableViewDataSource, UITableViewDelegate, UINavigationControllerDelegate, UISearchBarDelegate, NSXMLParserDelegate&gt; {
    UITableView         *theTableView;
    UILabel             *lbl_title;
    UILabel             *lbl_time;
    NSMutableArray      *mainLevelListArray;    

    NSXMLParser         *parser;
    NSMutableString     *elemName;
    NSMutableString     *currentValueString;
}

@property (nonatomic,retain) IBOutlet   UILabel         *lbl_title;
@property (nonatomic,retain) IBOutlet   UILabel         *lbl_time;
@property (nonatomic,retain) IBOutlet   UITableView     *theTableView;
@property (nonatomic, retain)           NSMutableArray  *mainLevelListArray;



- (IBAction)onClickLeftArrow;
- (IBAction)onClickRightArrow;

@end

 **

 - **3. .m file

** 

@implementation MainLevelList

    @synthesize mainLevelListArray; 
    @synthesize theTableView;
    @synthesize lbl_title;
    @synthesize lbl_time;



    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
        if (self) {
            // Custom initialization.
            UIButton *button1 =  [UIButton buttonWithType:UIButtonTypeCustom];
            [button1 setImage:[UIImage imageNamed:@"answerBtn.png"] forState:UIControlStateNormal];
            [button1 setFrame:CGRectMake(0, 0, 66, 34)];
            [button1 addTarget:self action:@selector(answerBtn:) forControlEvents:UIControlEventTouchUpInside];
            [button1 setTitle:@"Answer" forState:UIControlStateNormal];

            UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button1];
            NSMutableArray *toolBarItems = [[[NSMutableArray alloc] init] autorelease];
            [toolBarItems addObject:barButtonItem];
            //[self setToolbarItems:toolBarItems];

            UIButton *button3 =  [UIButton buttonWithType:UIButtonTypeCustom];
            [button3 setImage:[UIImage imageNamed:@"btmbar_Bg.png"] forState:UIControlStateNormal];
            [button3 setFrame:CGRectMake(150, 0, 66, 34)];
            [button3 addTarget:self action:@selector(home:) forControlEvents:UIControlEventTouchUpInside];
            [button3 setTitle:@"Home" forState:UIControlStateNormal];

            UIBarButtonItem *barButtonItem2 = [[UIBarButtonItem alloc] initWithCustomView:button3];
            [toolBarItems addObject:barButtonItem2];
            button3.hidden = YES;
            //[self setToolbarItems:toolBarItems];

            UIButton *button4 =  [UIButton buttonWithType:UIButtonTypeCustom];
            [button4 setImage:[UIImage imageNamed:@"btmbar_Bg.png"] forState:UIControlStateNormal];
            [button4 setFrame:CGRectMake(200, 0, 66, 34)];
            [button4 addTarget:self action:@selector(home:) forControlEvents:UIControlEventTouchUpInside];
            [button4 setTitle:@"Home" forState:UIControlStateNormal];

            UIBarButtonItem *barButtonItem3 = [[UIBarButtonItem alloc] initWithCustomView:button4];
            [toolBarItems addObject:barButtonItem3];
            button4.hidden = YES;

            UIButton *button2 =  [UIButton buttonWithType:UIButtonTypeCustom];
            [button2 setImage:[UIImage imageNamed:@"nextBtn.png"] forState:UIControlStateNormal];
            [button2 setFrame:CGRectMake(250, 0, 66, 34)];
            [button2 addTarget:self action:@selector(home:) forControlEvents:UIControlEventTouchUpInside];
            [button2 setTitle:@"Next" forState:UIControlStateNormal];

            UIBarButtonItem *barButtonItem1 = [[UIBarButtonItem alloc] initWithCustomView:button2];
            [toolBarItems addObject:barButtonItem1];
            [self setToolbarItems:toolBarItems];



        }
        return self;
    }

    - (void)viewDidLoad {
        [super viewDidLoad];


        NSString *responseXml = [[NSString alloc] initWithString:[[NSUserDefaults standardUserDefaults] valueForKey:@"responseXml"]];
        //[[NSUserDefaults standardUserDefaults] setObject:responseXml forKey:@"responseXml"];
        parser = [[NSXMLParser alloc] initWithData:[responseXml dataUsingEncoding:NSUTF8StringEncoding]];
        [responseXml release];

        [parser setDelegate:self];
        BOOL parseFlag = [parser parse];
        if (parseFlag == 1)
            if(debug)NSLog(@"parseFlag = YES");
            else 
            if(debug)NSLog(@"parseFlag = NO");



        UINavigationBar *bar = [self.navigationController navigationBar]; 

        CGRect labelRect = CGRectMake(255, 12, 60, 18);
        UILabel *label = [[UILabel alloc] initWithFrame:labelRect];
        [bar addSubview:label];
        label.text = @"ALRICK";
        label.textAlignment = UITextAlignmentLeft;
        label.font = [UIFont boldSystemFontOfSize:14];
        label.tag = 10;
        [label release];

        UIButton *logOutButton = [UIButton buttonWithType:100];
        [logOutButton setImage:[UIImage imageNamed:@"exitBtn.png"] forState:UIControlStateNormal];
        [logOutButton addTarget:self action:@selector(logoutButtonTouched) forControlEvents:UIControlEventTouchUpInside];
        [logOutButton setTitle:@"Logout" forState:UIControlStateNormal];
        UIBarButtonItem* logOutItem = [[UIBarButtonItem alloc] initWithCustomView:logOutButton];
        self.navigationItem.leftBarButtonItem = logOutItem;

        [lbl_title setText:@"Chain"];
        [lbl_title setTextColor:[UIColor whiteColor]];

        NSString *date = [NSDate date];
        //NSString *date = [[NSDate date] initWithFormat:@"EEE, MMM, h:mm"];
        NSLog(@"date:%@",date);
        [lbl_time setText:[NSString stringWithFormat:@"%@",date]];
        [lbl_time setTextColor:[UIColor whiteColor]]; 

        mainLevelListArray = [[NSMutableArray alloc] init];
        //[tableData addObject:@"ICA"];
    //  [tableData addObject:@"Bread"];
    //  [tableData addObject:@"ISF"];
    //  [tableData addObject:@"OSF"];
    //  [tableData addObject:@"BBC"];
    //  [tableData addObject:@"ACC"];
    //  [tableData addObject:@"CFF"];
    }

    -(void)answerBtn:(id)sender {
        QuestionnaireListView *m_questionnaireList = [[QuestionnaireListView alloc] initWithNibName:@"QuestionnaireListView" bundle:nil];
        [self.navigationController pushViewController:m_questionnaireList animated:YES];
        [m_questionnaireList release];
    }

    - (void)logoutButtonTouched {   
        [self.navigationController popViewControllerAnimated:YES];
    }

    - (IBAction)onClickLeftArrow {  

        //[self.navigationController popViewControllerAnimated:YES];
    }

    - (IBAction)onClickRightArrow { 

        //[self.navigationController popViewControllerAnimated:YES];
    }


    - (void)viewDidUnload {
        [super viewDidUnload];
    }

    - (void)dealloc {
        [super dealloc];
        [mainLevelListArray release];
    }

    #pragma mark - UITableView delegate methods

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 1;
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        return [mainLevelListArray count];
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *kCustomCellID = @"MyCellID";

        UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:kCustomCellID];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kCustomCellID] autorelease];
        }
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
            cell.textLabel.text = [mainLevelListArray objectAtIndex:indexPath.row];

            UIView *m_view = [[[UIView alloc] init] autorelease];
            m_view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"listHighlight_bg.png"]];
            cell.selectedBackgroundView = m_view;
            return cell;
    }


    - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {
        NSLog(@"element Name = %@", elementName);
        NSLog(@"namespace URI = %@", namespaceURI);
        NSLog(@"qualified Name = %@", qName);
        NSLog(@"attributeDict = %@", attributeDict);
        elemName = [[NSString alloc] initWithString:elementName];
        attributeDict = [[NSString alloc] initWithString:[attributeDict objectForKey:@"READ_TAG"]];
        //attribute = [attributeDict objectForKey:@"READ_TAG"];

    }

    - (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"]) {
            [mainLevelListArray addObject:currentValueString];

            [currentValueString release];
            currentValueString = nil;

            [elemName release];
            elemName = nil;

        }   
        else if ([elemName isEqualToString:@"USER"]) {
            [mainLevelListArray addObject:currentValueString];

            [currentValueString release];
            currentValueString = nil;

            [elemName release];
            elemName = nil;

        }   
        else if ([elemName isEqualToString:@"DATETIME"]) {
            [mainLevelListArray addObject:currentValueString];

            [currentValueString release];
            currentValueString = nil;

            [elemName release];
            elemName = nil;

        }   
        else if ([elemName isEqualToString:@"BREADCRUMB"]) {
            [mainLevelListArray addObject:currentValueString];

            [currentValueString release];
            currentValueString = nil;

            [elemName release];
            elemName = nil;

        }   
        else if ([elemName isEqualToString:@"LEVEL"]) {
            [mainLevelListArray addObject:currentValueString];

            [currentValueString release];
            currentValueString = nil;

            [elemName release];
            elemName = nil;
        }   

    }






    @end




**
</code></pre>
