+Mon Sep 6 14:27:38 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+ * libxslt/imports.c, libxslt/xslt.c, libxslt/xsltInternals.h:
+ fixed 2 problems with xsl:include (bug #151795)
+
Tue Aug 31 15:45:42 CEST 2004 Daniel Veillard <daniel@veillard.com>
* NEWS configure.in doc/*: Release of libxslt-1.1.10
xsltStylesheetPtr result;
xsltDocumentPtr include;
xsltDocumentPtr docptr;
+ int oldNopreproc;
if ((cur == NULL) || (style == NULL))
return (ret);
/* chain to stylesheet for recursion checking */
include->includes = style->includes;
style->includes = include;
+ oldNopreproc = style->nopreproc;
+ style->nopreproc = include->preproc;
result = xsltParseStylesheetProcess(style, include->doc);
+ style->nopreproc = oldNopreproc;
+ include->preproc = 1;
style->includes = include->includes;
style->doc = oldDoc;
if (result == NULL) {
prop = xsltGetNsProp(template, (const xmlChar *)"name", XSLT_NAMESPACE);
if (prop != NULL) {
const xmlChar *URI;
+ xsltTemplatePtr cur;
- if (ret->name != NULL) xmlFree(ret->name);
- ret->name = NULL;
- if (ret->nameURI != NULL) xmlFree(ret->nameURI);
- ret->nameURI = NULL;
+ if (ret->name != NULL) {
+ xmlFree(ret->name);
+ ret->name = NULL;
+ }
+ if (ret->nameURI != NULL) {
+ xmlFree(ret->nameURI);
+ ret->nameURI = NULL;
+ }
URI = xsltGetQNameURI(template, &prop);
if (prop == NULL) {
ret->nameURI = xmlStrdup(URI);
else
ret->nameURI = NULL;
+ cur = ret->next;
+ while (cur != NULL) {
+ if (xmlStrEqual(cur->name, prop)) {
+ xsltTransformError(NULL, style, template,
+ "xsl:template: error duplicate name '%s'\n", prop);
+ style->errors++;
+ goto error;
+ }
+ cur = cur->next;
+ }
}
}
return(NULL);
}
xsltParseStylesheetExcludePrefix(ret, cur);
- xsltPrecomputeStylesheet(ret, cur);
+ if (!ret->nopreproc)
+ xsltPrecomputeStylesheet(ret, cur);
if ((IS_XSLT_ELEM(cur)) &&
((IS_XSLT_NAME(cur, "stylesheet")) ||
xmlDocPtr doc; /* the parsed document */
void *keys; /* key tables storage */
struct _xsltDocument *includes; /* subsidiary includes */
+ int preproc; /* pre-processing already done */
};
typedef struct _xsltTransformContext xsltTransformContext;
* if namespace-alias has an alias for the default stylesheet prefix
*/
const xmlChar *defaultAlias;
+ /*
+ * bypass pre-processing (already done) (used in imports)
+ */
+ int nopreproc;
};
/*