+Mon Jan 8 19:55:18 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+ * libxslt/xslt.c : small cleanup
+ * configure.in libxslt/xsltconfig.h.in: add memory debug and
+ mechanism for compile-time options
+
Sun Jan 7 22:53:12 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* libxslt/xslt.[ch]: started parsing templates
AM_MAINTAINER_MODE
dnl
+dnl Debug for DV
+dnl
+if test "${LOGNAME}" = "veillard" ; then
+ if test "${with_mem_debug}" = "" ; then
+ with_mem_debug="yes"
+ fi
+ CFLAGS="-Wall -g -pedantic"
+fi
+AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
+if test "$with_mem_debug" = "yes" ; then
+ echo Enabling memory debug support
+ WITH_MEM_DEBUG=1
+else
+ WITH_MEM_DEBUG=0
+fi
+AC_SUBST(WITH_MEM_DEBUG)
+
+dnl
dnl The following new parameters were added to offer
dnl the ability to specify the location of the libxml
dnl library during linking and compilation.
AC_OUTPUT([
Makefile
libxslt/Makefile
+libxslt/xsltconfig.h
tests/Makefile
xslt-config
])
* Daniel.Veillard@imag.fr
*/
+#include "xsltconfig.h"
+
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlerror.h>
-#include <libxslt/xslt.h>
-#include <libxslt/xsltInternals.h>
+#include "xslt.h"
+#include "xsltInternals.h"
#define DEBUG_PARSING
xsltFreeTemplateList(xsltTemplatePtr template) {
xsltTemplatePtr cur;
- while (template == NULL) {
+ while (template != NULL) {
cur = template;
template = template->next;
xsltFreeTemplate(cur);
* Find and handle the params
*/
while (cur != NULL) {
+ /*
+ * Remove Blank nodes found at this level.
+ */
if (IS_BLANK_NODE(cur)) {
+ xmlNodePtr blank = cur;
+
cur = cur->next;
+ xmlUnlinkNode(blank);
+ xmlFreeNode(blank);
continue;
}
- if (!(IS_XSLT_ELEM(cur))) {
-#ifdef DEBUG_PARSING
- xsltGenericError(xsltGenericErrorContext,
- "xsltParseStylesheetTop : found foreign element %s\n",
- cur->name);
-#endif
+ if ((IS_XSLT_ELEM(cur)) && (xmlStrEqual(cur->name, "param"))) {
+ TODO /* Handle param */
+ } else
+ break;
+ cur = cur->next;
+ }
+
+ /*
+ * Browse the remaining of the template
+ */
+ while (cur != NULL) {
+ /*
+ * Remove Blank nodes found at this level.
+ */
+ if (IS_BLANK_NODE(cur)) {
+ xmlNodePtr blank = cur;
+
cur = cur->next;
+ xmlUnlinkNode(blank);
+ xmlFreeNode(blank);
continue;
}
- if (xmlStrEqual(cur->name, "param")) {
- TODO /* Handle param */
+ if ((IS_XSLT_ELEM(cur)) && (xmlStrEqual(cur->name, "param"))) {
+ xmlNodePtr param = cur;
+
+ cur = cur->next;
+ xsltGenericError(xsltGenericErrorContext,
+ "xsltParseStylesheetTop: ignoring misplaced param element\n");
+ xmlUnlinkNode(param);
+ xmlFreeNode(param);
+ continue;
} else
break;
cur = cur->next;
--- /dev/null
+/*
+ * xsltconfig.h: compile-time version informations for the XSLT engine
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@w3.org
+ */
+
+#ifndef __XML_XSLTCONFIG_H__
+#define __XML_XSLTCONFIG_H__
+
+#include "config.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if @WITH_MEM_DEBUG@
+#define DEBUG_MEMORY
+#define DEBUG_MEMORY_LOCATION
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XML_XSLTCONFIG_H__ */