* 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
| 5664 | * Returns 0 or 1 depending on the results of the test. |
| 5665 | */ |
| 5666 | static int |
| 5667 | xmlXPathCompareNodeSetValue(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: |
no test coverage detected