+Fri Jul 5 18:28:08 CEST 2002 Daniel Veillard <daniel@veillard.com>
+
+ * libxslt/preproc.c libxslt/transform.c: fixed bug #87279
+ * tests/docs/Makefile.am tests/docs/bug-88.xml
+ tests/general/Makefile.am tests/general/bug-88.*: added an
+ example in the regression tests for this case
+
Fri Jul 5 16:30:02 CEST 2002 Daniel Veillard <daniel@veillard.com>
* libxslt/preproc.c libxslt/xsltutils.c: applied a patch from
comp->ns = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"namespace",
XSLT_NAMESPACE, &comp->has_ns);
+ if (comp->has_ns == 0) {
+ xmlNsPtr defaultNs;
+ defaultNs = xmlSearchNs(inst->doc, inst, NULL);
+ if (defaultNs != NULL) {
+ comp->ns = xmlStrdup(defaultNs->href);
+ comp->has_ns = 1;
+ }
+ }
comp->use = xsltEvalStaticAttrValueTemplate(style, inst,
(const xmlChar *)"use-attribute-sets",
XSLT_NAMESPACE, &comp->has_use);
xmlNsPtr ns = NULL, oldns = NULL;
xmlNodePtr copy;
xmlNodePtr oldInsert;
+ int generateDefault = 0;
if (ctxt->insert == NULL)
ctxt->insert);
xmlFree(namespace);
}
+ } else if ((comp->ns != NULL) && (prefix == NULL) && (comp->has_ns)) {
+ generateDefault = 1;
} else if (comp->ns != NULL) {
ns = xsltGetSpecialNamespace(ctxt, inst, comp->ns, prefix,
ctxt->insert);
"xsl:element : creation of %s failed\n", name);
goto error;
}
- if ((ns == NULL) && (oldns != NULL)) {
+ if (generateDefault == 1) {
+ ns = xmlNewNs(copy, comp->ns, NULL);
+ copy->ns = ns;
+ } else if ((ns == NULL) && (oldns != NULL)) {
/* very specific case xsltGetNamespace failed */
ns = xmlNewNs(copy, oldns->href, oldns->prefix);
copy->ns = ns;
bug-84.xml \
bug-86.xml \
bug-87.xml \
+ bug-88.xml \
character.xml \
array.xml \
items.xml
bug-84.out bug-84.xsl \
bug-86.out bug-86.xsl \
bug-87.out bug-87.xsl \
+ bug-88.out bug-88.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \
--- /dev/null
+<?xml version="1.0"?>
+<test xmlns="http://bar.xml"/>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:template match="/">
+ <xsl:element xmlns="http://bar.xml" name="test"/>
+ </xsl:template>
+</xsl:stylesheet>