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

Function xmlXPathNodeSetContains

ThirdParty/libxml2/vtklibxml2/xpath.c:2810–2836  ·  view source on GitHub ↗

* xmlXPathNodeSetContains: * @cur: the node-set * @val: the node * * checks whether @cur contains @val * * Returns true (1) if @cur contains @val, false (0) otherwise */

Source from the content-addressed store, hash-verified

2808 * Returns true (1) if @cur contains @val, false (0) otherwise
2809 */
2810int
2811xmlXPathNodeSetContains (xmlNodeSetPtr cur, xmlNodePtr val) {
2812 int i;
2813
2814 if ((cur == NULL) || (val == NULL)) return(0);
2815 if (val->type == XML_NAMESPACE_DECL) {
2816 for (i = 0; i < cur->nodeNr; i++) {
2817 if (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) {
2818 xmlNsPtr ns1, ns2;
2819
2820 ns1 = (xmlNsPtr) val;
2821 ns2 = (xmlNsPtr) cur->nodeTab[i];
2822 if (ns1 == ns2)
2823 return(1);
2824 if ((ns1->next != NULL) && (ns2->next == ns1->next) &&
2825 (xmlStrEqual(ns1->prefix, ns2->prefix)))
2826 return(1);
2827 }
2828 }
2829 } else {
2830 for (i = 0; i < cur->nodeNr; i++) {
2831 if (cur->nodeTab[i] == val)
2832 return(1);
2833 }
2834 }
2835 return(0);
2836}
2837
2838/**
2839 * xmlXPathNodeSetAddNs:

Callers 6

xmlC14NIsNodeInNodesetFunction · 0.85
xmlXPathDifferenceFunction · 0.85
xmlXPathIntersectionFunction · 0.85
xmlXPathHasSameNodesFunction · 0.85

Calls 1

xmlStrEqualFunction · 0.85

Tested by

no test coverage detected