ObjectiveCでのxml解析にGDataXMLライブラリを使用しているiOSアプリを作成しています。
私は次の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>
<MakeRequestResponse xmlns="http://tempuri.org/">
<MakeRequestResult>SOMERANDOMDATAHERE012912033905345346</MakeRequestResult>
</MakeRequestResponse>
</soap:Body>
</soap:Envelope>
私が抱えている問題は次のとおりです。
指定されたxmlのxpath式を次のように記述すると、MakeRequestResponseノードが取得されます。
NSArray *listOfNodes = [[responseDocument rootElement] nodesForXPath:@"soap:Body/*" error:&error];
ただし、実際のノード名を書き込むと、このノードまたは以下の子を取得できません。
NSArray *listOfNodes = [[responseDocument rootElement] nodesForXPath:@"soap:Body/MakeRequestResponse" error:&error];
ここで何が問題なのかわかりません。名前空間に関連する問題でしょうか?