From: William M. Brack Date: Mon, 14 Feb 2005 15:12:42 +0000 (+0000) Subject: fixed a problem with exclude-result-prefixes (bug 165560) X-Git-Tag: v1.1.28~324 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0af37d3fc7e1a1f6bd39e8441b3df4db42d7dfa1;p=platform%2Fupstream%2Flibxslt.git fixed a problem with exclude-result-prefixes (bug 165560) * libxslt/namespaces.c: fixed a problem with exclude-result-prefixes (bug 165560) --- diff --git a/ChangeLog b/ChangeLog index f5ed1f9..a753186 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 14 23:10:21 HKT 2005 William Brack + + * libxslt/namespaces.c: fixed a problem with + exclude-result-prefixes (bug 165560) + Mon Feb 14 12:51:07 CET 2005 Daniel Veillard * libxslt/variables.c: added a cretion of ctxt->globalVars in diff --git a/libxslt/namespaces.c b/libxslt/namespaces.c index 6a5b080..0589d04 100644 --- a/libxslt/namespaces.c +++ b/libxslt/namespaces.c @@ -446,11 +446,18 @@ xsltGetNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns, */ if ((ret == NULL) && (ns->prefix != NULL)) ret = xmlSearchNsByHref(out->doc, out, URI); - } + } - if (ret == NULL) { /* if no success and an element node, create the ns */ - if (out->type == XML_ELEMENT_NODE) - ret = xmlNewNs(out, URI, ns->prefix); + /* + * For an element node, if we don't find it, or it's the default + * and this element already defines a default (bug 165560), we need to + * create it. + */ + if (out->type == XML_ELEMENT_NODE) { + if ((ret == NULL) || ((ret->prefix == NULL) && (out->ns == NULL) && + (out->nsDef != NULL) && (!xmlStrEqual(URI, out->nsDef->href)))) { + ret = xmlNewNs(out, URI, ns->prefix); + } } return(ret); }