I need to do xml parsing in my class.
i found
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName
attributes: (NSDictionary *)attributeDict
{
}
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
}
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
}
But in need to do parsing two times one after another,How can i done using these methods
can any one pls help me.
Thank u in advance.
You want to do something like this?
Have a flag variable of any type. Let us consider the flag variable is NSString. And you are going to parse two XML files. Consider, one XML is for listing items and another one is for detail view.
Before you parse the first XML (the XML for list, in our case) you set the flag something like this,
Then, before you parse the second XML (the XML for detail) you set the flag something like this,
In your parser methods, do the following,
Note: You can have the flag to be of any type, not necessarily NSString.
I hope this is what you expect.