首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

xml解析,求大神帮忙??解决办法

2012-12-16 
xml解析,求大神帮忙??1.xml如下所示?xml version1.0 encodingutf-8?soap:Envelope xmlns:soaph

xml解析,求大神帮忙??
1.xml如下所示


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetCircularTypeResponse xmlns="http://tempuri.org/">
<GetCircularTypeResult>
  内容??
</GetCircularTypeResult>
</GetCircularTypeResponse>
</soap:Body>
</soap:Envelope>


2.使用good api,GDataXMLNode如何获取节点GetCircularTypeResult内容
  求大神帮忙
[解决办法]


NSString *filePath = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"xml"];  NSData *xmlData = [[NSMutableData alloc] initWithContentsOfFile:filePath];
  NSError *error; 
 GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:xmlData options:0 error:&error];
  if (doc == nil) { return nil; } 
 NSLog(@"%@", doc.GetCircularTypeResult); 
 [doc release]; 
 [xmlData release]; 



明白?
[解决办法]
doc.GetCircularTypeResult===>这个GetCircularTypeResult可以为动态的吗?
比如我这次调用webservice的GetCircularType方法返回的内容包含在GetCircularTypeResult节点中,
我调用另一个方法GetCircular方法返回的内容包含在GetCircularResult中

另外小问一个问题,xml有命名空间的是怎么读取?
[解决办法]
引用:
C/C++ code


NSString *filePath = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"xml"];  NSData *xmlData = [[NSMutableData alloc] initWithContentsOfFile:filePath];
  NSError *error; 
 GDataXML……


doc.GetCircularTypeResult报错,提示不存在?
[解决办法]
有木有大牛???

热点排行