开发者

suppress namespace prefixes on nsxmlparser

开发者 https://www.devze.com 2023-03-02 01:21 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消