+Wed Mar 7 23:22:09 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * libxslt/preproc.c libxslt/xsltInternals.h: fixed a stylesheet
+ reuse problem.
+ * libxslt/transform.c: fixed a bug which exaplined why no
+ optimization were resulting from preproc stuff
+
Wed Mar 7 21:51:52 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* libxslt/preproc.c libxslt/transform.c: a couple of nastyness
xsltFreeStylePreComp(xsltStylePreCompPtr comp) {
if (comp == NULL)
return;
+ if (comp->inst != NULL)
+ comp->inst->_private = NULL;
if (comp->stype != NULL)
xmlFree(comp->stype);
if (comp->order != NULL)
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->ver11 = 0;
if (xmlStrEqual(inst->name, (const xmlChar *) "output")) {
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->stype = xsltEvalStaticAttrValueTemplate(ctxt, inst,
(const xmlChar *)"data-type", &comp->has_stype);
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->use = xmlGetNsProp(inst, (const xmlChar *)"use-attribute-sets",
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->noescape = 0;
prop = xmlGetNsProp(inst,
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
/*
* TODO: more computation can be done there, especially namespace lookup
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
/*
* TODO: more computation can be done there, especially namespace lookup
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
}
/**
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->name = xsltEvalStaticAttrValueTemplate(ctxt, inst,
(const xmlChar *)"name", &comp->has_name);
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->select = xmlGetNsProp(inst, (const xmlChar *)"select",
XSLT_NAMESPACE);
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
prop = xmlGetNsProp(inst,
(const xmlChar *)"disable-output-escaping",
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
}
/**
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
/*
* The full template resolution can be done statically
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
/*
* Get mode if any
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
}
/**
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->test = xmlGetNsProp(inst, (const xmlChar *)"test", XSLT_NAMESPACE);
if (comp->test == NULL) {
if (comp == NULL)
return;
inst->_private = comp;
+ comp->inst = inst;
comp->select = xmlGetNsProp(inst, (const xmlChar *)"select",
XSLT_NAMESPACE);
*/
void
xsltStylePreCompute(xsltTransformContextPtr ctxt, xmlNodePtr inst) {
+ if (inst->_private != NULL)
+ return;
if (IS_XSLT_ELEM(inst)) {
if (IS_XSLT_NAME(inst, "apply-templates")) {
xsltApplyTemplatesComp(ctxt, inst);
}
if (IS_XSLT_ELEM(cur)) {
- xsltStylePreCompute(ctxt, cur);
+ if (cur->_private == NULL)
+ xsltStylePreCompute(ctxt, cur);
+
if (cur->_private != NULL) {
xsltStylePreCompPtr info = (xsltStylePreCompPtr) cur->_private;
if (info->func != NULL) {