suppress namespace prefixes on nsxmlparser
my xml data has nodes in this format . I want to suppress the prefixes, that is when i pull the element name in nsxmlparser'开发者_如何学JAVAs delegate method it should not return as "yyy" and not as "xxx:yyy"
I tries to do this
[parser setDelegate:self];
[parser setShouldProcessNamespaces:NO];
[parser setShouldReportNamespacePrefixes:NO];
this code did not had any effect. what has to be done?
[parser setDelegate:self];
[parser setShouldProcessNamespaces:YES];
[parser setShouldReportNamespacePrefixes:NO];
i got it . . should change the 2nd line to YES.
In your
- (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
you can probably use
[attributeDict objectForKey:@"xx"]; to get yyy
精彩评论