diff options
author | Mike Hommey <mh@glandium.org> | 2004-04-19 05:38:48 +0000 |
---|---|---|
committer | Mike Hommey <mh@glandium.org> | 2004-04-19 05:38:48 +0000 |
commit | 81bcf076ea11e114a60e429338a15748066de163 (patch) | |
tree | 276010ab5d17f27a96c05f77004aa84a1763af7b /xpath.c | |
parent | d09ab089457ae3c20cc98f9afa03379c6ebf9598 (diff) | |
download | libxml2-81bcf076ea11e114a60e429338a15748066de163.tar.gz |
Load /tmp/tmp.LovooJ/libxml2-2.6.9 intoupstream/2.6.9
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'xpath.c')
-rw-r--r-- | xpath.c | 34 |
1 files changed, 22 insertions, 12 deletions
@@ -6089,18 +6089,23 @@ xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) { ID = xmlStrndup(ids, cur - ids); if (ID != NULL) { - if (xmlValidateNCName(ID, 1) == 0) { - attr = xmlGetID(doc, ID); - if (attr != NULL) { - if (attr->type == XML_ATTRIBUTE_NODE) - elem = attr->parent; - else if (attr->type == XML_ELEMENT_NODE) - elem = (xmlNodePtr) attr; - else - elem = NULL; - if (elem != NULL) - xmlXPathNodeSetAdd(ret, elem); - } + /* + * We used to check the fact that the value passed + * was an NCName, but this generated much troubles for + * me and Aleksey Sanin, people blatantly violated that + * constaint, like Visa3D spec. + * if (xmlValidateNCName(ID, 1) == 0) + */ + attr = xmlGetID(doc, ID); + if (attr != NULL) { + if (attr->type == XML_ATTRIBUTE_NODE) + elem = attr->parent; + else if (attr->type == XML_ELEMENT_NODE) + elem = (xmlNodePtr) attr; + else + elem = NULL; + if (elem != NULL) + xmlXPathNodeSetAdd(ret, elem); } xmlFree(ID); } @@ -10917,7 +10922,12 @@ xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt, case XPATH_BOOLEAN: return(res->boolval); case XPATH_NUMBER: +#ifdef WIN32 + return(((res->floatval == ctxt->context->proximityPosition) && + (!xmlXPathIsNaN(res->floatval)) /* MSC pbm Mark Vadoc !*/); +#else return(res->floatval == ctxt->context->proximityPosition); +#endif case XPATH_NODESET: case XPATH_XSLT_TREE: if (res->nodesetval == NULL) |