From: Daniel Veillard Date: Mon, 8 Jan 2001 18:57:17 +0000 (+0000) Subject: Not much: - libxslt/xslt.c : small cleanup - configure.in X-Git-Tag: v1.1.28~1544 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eaf99d5e12d57c7e150ba50e5df0a73121c14394;p=platform%2Fupstream%2Flibxslt.git Not much: - libxslt/xslt.c : small cleanup - configure.in Not much: - libxslt/xslt.c : small cleanup - configure.in libxslt/xsltconfig.h.in: add memory debug and mechanism for compile-time options Daniel --- diff --git a/ChangeLog b/ChangeLog index 6e6ea7d..08f0e62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Jan 8 19:55:18 CET 2001 Daniel Veillard + + * 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 * libxslt/xslt.[ch]: started parsing templates diff --git a/configure.in b/configure.in index 86e9dc6..7f6b287 100644 --- a/configure.in +++ b/configure.in @@ -8,6 +8,24 @@ AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) 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. @@ -100,6 +118,7 @@ AC_SUBST(XSLT_LIBS) AC_OUTPUT([ Makefile libxslt/Makefile +libxslt/xsltconfig.h tests/Makefile xslt-config ]) diff --git a/libxslt/xslt.c b/libxslt/xslt.c index 5c06080..f4886be 100644 --- a/libxslt/xslt.c +++ b/libxslt/xslt.c @@ -9,14 +9,16 @@ * Daniel.Veillard@imag.fr */ +#include "xsltconfig.h" + #include #include #include #include #include -#include -#include +#include "xslt.h" +#include "xsltInternals.h" #define DEBUG_PARSING @@ -123,7 +125,7 @@ void xsltFreeTemplateList(xsltTemplatePtr template) { xsltTemplatePtr cur; - while (template == NULL) { + while (template != NULL) { cur = template; template = template->next; xsltFreeTemplate(cur); @@ -202,21 +204,48 @@ xsltParseStylesheetTemplate(xsltStylesheetPtr style, xmlNodePtr template) { * 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; diff --git a/libxslt/xsltconfig.h.in b/libxslt/xsltconfig.h.in new file mode 100644 index 0000000..f8421f6 --- /dev/null +++ b/libxslt/xsltconfig.h.in @@ -0,0 +1,27 @@ +/* + * 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__ */