MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXPathCompareNodeSetValue

Function xmlXPathCompareNodeSetValue

ThirdParty/libxml2/vtklibxml2/xpath.c:5666–5692  ·  view source on GitHub ↗

* xmlXPathCompareNodeSetValue: * @ctxt: the XPath Parser context * @inf: less than (1) or greater than (0) * @strict: is the comparison strict * @arg: the node set * @val: the value * * Implement the compare operation between a nodeset and a value * @ns < @val (1, 1, ... * @ns <= @val (1, 0, ... * @ns > @val (0, 1, ... * @ns >= @val (0, 0, ... * * If one

Source from the content-addressed store, hash-verified

5664 * Returns 0 or 1 depending on the results of the test.
5665 */
5666static int
5667xmlXPathCompareNodeSetValue(xmlXPathParserContextPtr ctxt, int inf, int strict,
5668 xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
5669 if ((val == NULL) || (arg == NULL) ||
5670 ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
5671 return(0);
5672
5673 switch(val->type) {
5674 case XPATH_NUMBER:
5675 return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
5676 case XPATH_NODESET:
5677 case XPATH_XSLT_TREE:
5678 return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
5679 case XPATH_STRING:
5680 return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
5681 case XPATH_BOOLEAN:
5682 valuePush(ctxt, arg);
5683 xmlXPathBooleanFunction(ctxt, 1);
5684 valuePush(ctxt, val);
5685 return(xmlXPathCompareValues(ctxt, inf, strict));
5686 default:
5687 xmlXPathReleaseObject(ctxt->context, arg);
5688 xmlXPathReleaseObject(ctxt->context, val);
5689 XP_ERROR0(XPATH_INVALID_TYPE);
5690 }
5691 return(0);
5692}
5693
5694/**
5695 * xmlXPathEqualNodeSetString:

Callers 1

xmlXPathCompareValuesFunction · 0.85

Calls 7

xmlXPathCompareNodeSetsFunction · 0.85
valuePushFunction · 0.85
xmlXPathBooleanFunctionFunction · 0.85
xmlXPathCompareValuesFunction · 0.85
xmlXPathReleaseObjectFunction · 0.85

Tested by

no test coverage detected