NSError *error;
NSData *data=[NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"universal-science" ofType:@"xml"]];
NSDictionary *xmlDic=[XMLReader dictionaryForXMLData:data error:&error];
NSLog(@"book %@",xmlDic);
NSLog(@"chapter %@",[xmlDic valueForKeyPath:@"book.chapter"]);
NSLog(@"title : %@",[xmlDic valueForKeyPath:@"book.chapter.title"]);
title_Text.text = [NSString stringWithFormat:@"%@",[xmlDic valueForKeyPath:@"book.chapter.title.text"]];
subTitle.text=[NSString stringWithFormat:@"%@",[xmlDic valueForKeyPath:@"book.chapter.section.objectiveset.title.text"]];
para_Text.text = [NSString stringWithFormat:@"%@",[xmlDic valueForKeyPath:@"book.chapter.section.objectiveset.objective.para.text"]];
No comments:
Post a Comment