}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj == NULL) || (obj->type != XPATH_STRING) ||
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
xmlXPathFreeObject(obj);
if (ret == NULL) {
virReportOOMError(conn);
}
- ctxt->node = relnode;
return (ret);
}
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj == NULL) || (obj->type != XPATH_NUMBER) ||
(isnan(obj->floatval))) {
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (-1);
}
*value = obj->floatval;
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (0);
}
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj != NULL) && (obj->type == XPATH_STRING) &&
(obj->stringval != NULL) && (obj->stringval[0] != 0)) {
char *conv = NULL;
}
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (ret);
}
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj != NULL) && (obj->type == XPATH_STRING) &&
(obj->stringval != NULL) && (obj->stringval[0] != 0)) {
char *conv = NULL;
}
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (ret);
}
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj != NULL) && (obj->type == XPATH_STRING) &&
(obj->stringval != NULL) && (obj->stringval[0] != 0)) {
char *conv = NULL;
}
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (ret);
}
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj == NULL) || (obj->type != XPATH_BOOLEAN) ||
(obj->boolval < 0) || (obj->boolval > 1)) {
xmlXPathFreeObject(obj);
ret = obj->boolval;
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (ret);
}
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj == NULL) || (obj->type != XPATH_NODESET) ||
(obj->nodesetval == NULL) || (obj->nodesetval->nodeNr <= 0) ||
(obj->nodesetval->nodeTab == NULL)) {
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (NULL);
}
ret = obj->nodesetval->nodeTab[0];
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (ret);
}
relnode = ctxt->node;
obj = xmlXPathEval(BAD_CAST xpath, ctxt);
+ ctxt->node = relnode;
if ((obj == NULL) || (obj->type != XPATH_NODESET) ||
(obj->nodesetval == NULL) || (obj->nodesetval->nodeNr < 0)) {
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (-1);
}
}
}
xmlXPathFreeObject(obj);
- ctxt->node = relnode;
return (ret);
}