Re: [xml] xpath and xmlXPathObject::nodesetval, need clarification



In the meantime, I found that the null pointer is produced in libxml's xpath.c

    contextSeq = obj->nodesetval;
    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
        xmlXPathReleaseObject(xpctxt, obj);
        valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, NULL));
        return(0);
    }

Is this ok? Why deallocate and return null, instead of keeping things
consistent?
Also, I wonder... is it possible that the code I posted earlier is
handling things incorrectly? Perhaps the 'nodesetval' pointer is for
internal use only, and the application should use proper API functions
to step through the result set? If so, how?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]