i am developping an ios application and i am parsing my xml with gdataxml, but i am doing it wrong, my nslog is null
NSError *error = nil;
GDataXMLDocument *xmlResult = [[GDataXMLDocument alloc] initWithData:data options:0 error:&error];
if (error) {
NSLog(@"%@",error);
}
NSLog(@"%@",xmlResult.rootElement); my root element is perfect, the error is with tempArray
NSArray *tempArray = [xmlResult nodesForXPath:@"//message/error/value" error:&error];
NSLog(@"mon array %@",tempArray);
my array is null,
my xml is like this :
<message xmlns="http://.....Api" xmlns:i="http://www.w3.org/....">
<error i:nil="true"/>
<value>
i am sur that my problème is with the namespace, but i don't how to do it ?
thanks for your answer
After some testing with GDataXMLNode, here is my answer:
You can see this comment in GDataXMLNode.h:
It states that you can actually use _def_ns as your namespace. However, you can also set your own namespace in case there are other namespaces in your document.