I am creating an iOS application where I use the GDataXML library to parse xml in Objective C.
I have the following xml (which I get as a response to soap):
<?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> <MakeRequestResponse xmlns="http://tempuri.org/"> <MakeRequestResult>SOMERANDOMDATAHERE012912033905345346</MakeRequestResult> </MakeRequestResponse> </soap:Body> </soap:Envelope>
I have a problem:
when I write an xpath expression for a given xml like this, I get a MakeRequestResponse node:
NSArray *listOfNodes = [[responseDocument rootElement] nodesForXPath:@"soap:Body/*" error:&error];
However, I cannot get this node or other children below when I write the actual name of the node:
NSArray *listOfNodes = [[responseDocument rootElement] nodesForXPath:@"soap:Body/MakeRequestResponse" error:&error];
I am not sure what the problem is. Could this be a namespace related issue?
source share