Commit e209b330 authored by Daniel Veillard's avatar Daniel Veillard

fixed bug #109160 on non-ASCII IDs Daniel

* xpath.c: fixed bug #109160 on non-ASCII IDs
Daniel
parent 642104e1
Wed Mar 26 22:38:39 CET 2003 Daniel Veillard <daniel@veillard.com>
* xpath.c: fixed bug #109160 on non-ASCII IDs
Wed Mar 26 17:30:37 CET 2003 Daniel Veillard <daniel@veillard.com>
* parser.c: Norm suggested a nicer error message for xml:space values
......
......@@ -5946,23 +5946,26 @@ xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
while (IS_BLANK(*cur)) cur++;
while (*cur != 0) {
while ((IS_LETTER(*cur)) || (IS_DIGIT(*cur)) ||
(*cur == '.') || (*cur == '-') ||
(*cur == '_') || (*cur == ':') ||
(IS_COMBINING(*cur)) ||
(IS_EXTENDER(*cur)))
cur++;
if ((!IS_BLANK(*cur)) && (*cur != 0)) break;
while ((!IS_BLANK(*cur)) && (*cur != 0))
cur++;
ID = xmlStrndup(ids, cur - ids);
attr = xmlGetID(doc, ID);
if (attr != NULL) {
elem = attr->parent;
xmlXPathNodeSetAdd(ret, elem);
}
if (ID != NULL)
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);
}
}
xmlFree(ID);
}
while (IS_BLANK(*cur)) cur++;
ids = cur;
......
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