summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-04-19 05:38:48 +0000
committerMike Hommey <mh@glandium.org>2004-04-19 05:38:48 +0000
commit81bcf076ea11e114a60e429338a15748066de163 (patch)
tree276010ab5d17f27a96c05f77004aa84a1763af7b /xpath.c
parentd09ab089457ae3c20cc98f9afa03379c6ebf9598 (diff)
downloadlibxml2-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.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/xpath.c b/xpath.c
index 881e936..554350d 100644
--- a/xpath.c
+++ b/xpath.c
@@ -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)