1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

fix of an XSLT namespace bug reported on the list general/bug-8- Daniel

* xpath.c: fix of an XSLT namespace bug reported on the list general/bug-8-
Daniel
This commit is contained in:
Daniel Veillard
2001-04-30 20:31:33 +00:00
parent 5792e16f05
commit c8f620ba7f
2 changed files with 14 additions and 2 deletions

11
xpath.c
View File

@ -1966,8 +1966,15 @@ xmlXPathNsLookup(xmlXPathContextPtr ctxt, const xmlChar *prefix) {
return(XML_XML_NAMESPACE);
#endif
if (ctxt->nsHash == NULL)
return(NULL);
if (ctxt->namespaces != NULL) {
int i;
for (i = 0;i < ctxt->nsNr;i++) {
if ((ctxt->namespaces[i] != NULL) &&
(xmlStrEqual(ctxt->namespaces[i]->prefix, prefix)))
return(ctxt->namespaces[i]->href);
}
}
return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
}