summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
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)