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
diff --git a/xpath.c b/xpath.c
index d65f251..5c83a8d 100644
--- a/xpath.c
+++ b/xpath.c
@@ -1966,8 +1966,15 @@
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));
}