Commit c125a721 authored by William M. Brack's avatar William M. Brack

fixed bug 126976 (string != empty nodeset should be false)

* xpath.c: fixed bug 126976 (string != empty nodeset
  should be false)
parent 60f394e9
Sun Nov 16 16:03:24 HKT 2003 William Brack <wbrack@mmm.com.hk>
* xpath.c: fixed bug 126976 (string != empty nodeset
should be false)
Sun Nov 16 14:00:08 HKT 2003 William Brack <wbrack@mmm.com.hk>
* doc/html/*.html: Finally - found the problem with the
......
......@@ -4359,14 +4359,13 @@ xmlXPathEqualNodeSetString(xmlXPathObjectPtr arg, const xmlChar * str, int neq)
((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
return (0);
ns = arg->nodesetval;
hash = xmlXPathStringHash(str);
if (ns == NULL)
/*
* A NULL nodeset compared with a string is always false
* (since there is no node equal, and no node not equal)
*/
if ((ns == NULL) || (ns->nodeNr <= 0) )
return (0);
if (ns->nodeNr <= 0) {
if (hash == 0)
return(neq ^ 1);
return(neq);
}
hash = xmlXPathStringHash(str);
for (i = 0; i < ns->nodeNr; i++) {
if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
str2 = xmlNodeGetContent(ns->nodeTab[i]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment