+Mon Mar 5 21:51:54 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * libxslt/pattern.[ch] libxslt/transform.c: added
+ xsltCleanupTemplates() to clean up state left after processing.
+
Sun Mar 4 19:03:27 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* libxslt/transform.c: applied patch from William M. Brack
dnl find libxml
dnl
XML_CONFIG="xml2-config"
-AC_MSG_CHECKING(for libxml libraries >= 2.3.3)
+AC_MSG_CHECKING(for libxml libraries >= 2.3.2)
if test "x$LIBXML_PREFIX" != "x"
then
if ${LIBXML_PREFIX}/bin/xml2-config --libs print > /dev/null 2>&1
if test "x$XML_CONFIG" != "x"
then
vers=`$XML_CONFIG --version | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
- if test "$vers" -ge 2003003
+ if test "$vers" -ge 2003002
then
LIBXML_LIBS="`$XML_CONFIG --libs`"
LIBXML_CFLAGS="`$XML_CONFIG --cflags`"
AC_MSG_RESULT(found)
else
- AC_MSG_ERROR(You need at least libxml 2.3.3 for this version of libxslt)
+ AC_MSG_ERROR(You need at least libxml 2.3.2 for this version of libxslt)
fi
else
AC_MSG_ERROR(Could not find libxml2 anywhere, check ftp://xmlsoft.org/.)
comp->steps[comp->nbStep++].op = XSLT_OP_END;
}
+/**
+ * xsltCleanupCompMatch:
+ * @comp: the compiled match expression
+ *
+ * remove all computation state from the pattern
+ */
+void
+xsltCleanupCompMatch(xsltCompMatchPtr comp) {
+ int i;
+
+ for (i = 0;i < comp->nbStep;i++) {
+ comp->steps[i].previous = NULL;
+ }
+}
+
/************************************************************************
* *
* The interpreter for the precompiled patterns *
return(NULL);
}
+/**
+ * xsltCleanupTemplates:
+ * @style: an XSLT stylesheet
+ *
+ * Cleanup the state of the templates used by the stylesheet and
+ * the ones it imports.
+ */
+void
+xsltCleanupTemplates(xsltStylesheetPtr style) {
+ while (style != NULL) {
+ xmlHashScan((xmlHashTablePtr) style->templatesHash,
+ (xmlHashScanner) xsltCleanupCompMatch, NULL);
+
+ style = xsltNextImport(style);
+ }
+}
/**
* xsltFreeTemplateHashes:
xmlNodePtr node,
xsltStylesheetPtr style);
void xsltFreeTemplateHashes (xsltStylesheetPtr style);
+void xsltCleanupTemplates (xsltStylesheetPtr style);
+
#if 0
int xsltMatchPattern (xsltTransformContextPtr ctxt,
xmlNodePtr node,
varsPush(ctxt, NULL);
xsltProcessOneNode(ctxt, ctxt->node);
xsltFreeStackElemList(varsPop(ctxt));
+ xsltCleanupTemplates(style);
if ((ctxt->type = XSLT_OUTPUT_XML) &&