+Mon Feb 14 23:10:21 HKT 2005 William Brack <wbrack@mmm.com.hk>
+
+ * libxslt/namespaces.c: fixed a problem with
+ exclude-result-prefixes (bug 165560)
+
Mon Feb 14 12:51:07 CET 2005 Daniel Veillard <daniel@veillard.com>
* libxslt/variables.c: added a cretion of ctxt->globalVars in
*/
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);
}