From c8f620ba7f95b3ceb687699e140eeaa33343e41a Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 30 Apr 2001 20:31:33 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ xpath.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90392865..52c86a83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 30 22:29:34 CEST 2001 Daniel Veillard + + * xpath.c: fix of an XSLT namespace bug reported on the list + general/bug-8- + Mon Apr 30 19:42:58 CEST 2001 Daniel Veillard * strio.h trio.c: Dan McNichol suggested a couple of small diff --git a/xpath.c b/xpath.c index d65f2513..5c83a8d8 100644 --- a/xpath.c +++ b/xpath.c @@ -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)); }