I have a big mystery here,
I have a Gdataxml document property:
GDataXMLDocument *doc;
I\'m adding a new element to doc, interestin
Your problem is here:
<inferenceresponse xmlns="">
The empty namespace attribute is obviously confusing the libxml XPath evaluation. If you step through GDataXMLNode's nodesForXPath:namespaces:error:
, xmlXPathEval
indeed returns an empty nodes set.
If you have control over the XML generation, I've got correct XPath results removing the empty attribute.
<inferenceresponse>
If modifying the server response is too hard, you can edit GDataXMLNode.m
:
Find the method fixQualifiedNamesForNode:graftingToTreeNode:
in GDataXMLNode implementation and replace the line
if (foundNS != NULL) {
// we found a namespace, so fix the ns pointer and the local name
with
if (foundNS != NULL && foundNS->href != NULL && strlen((char *)foundNS->href) != 0) {
// we found a namespace, so fix the ns pointer and the local name