我正在使用GDataXML来解析may XML,但是我有一个问题:
<....
<images xmlns:a="http://.../Arrays">
<a:string>http://images...233/Detail.jpg</a:string>
<a:string>http://images....233/Detail2.jpg</a:string>
</images>
.../>我想有我的图像的所有网址,并把它放在一个NSArray,我这样做:
NSError *error = nil;
GDataXMLDocument *xmlResult = [[GDataXMLDocument alloc] initWithData:data options:0 error:&error];
if (error) {
NSLog(@"%@",error);
}
.......
NSArray *array = [... nodesForXPath:@"images" namespaces:a error:&error];我的数组,它不为空
现在我想访问我的图像url,但我不能,我是这样做的:
arrar = [array elementsForName:@"a"];我的数组是空的,我想问题出在命名空间上,我不知道如何解决这个问题,谢谢你的回答
发布于 2012-02-27 01:14:57
我认为这个问题与此相关:parse xml with namespaces with gdata xml。检查我的答案。希望它能有所帮助!:)
https://stackoverflow.com/questions/9375165
复制相似问题