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
This commit is contained in:
Daniel Veillard 2001-01-08 18:57:17 +00:00
parent 2a7128361b
commit eaf99d5e12
4 changed files with 94 additions and 13 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -7,6 +7,24 @@ AM_CONFIG_HEADER(config.h)
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
@ -100,6 +118,7 @@ AC_SUBST(XSLT_LIBS)
AC_OUTPUT([
Makefile
libxslt/Makefile
libxslt/xsltconfig.h
tests/Makefile
xslt-config
])

View File

@ -9,14 +9,16 @@
* 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
@ -123,7 +125,7 @@ void
xsltFreeTemplateList(xsltTemplatePtr template) {
xsltTemplatePtr cur;
while (template == NULL) {
while (template != NULL) {
cur = template;
template = template->next;
xsltFreeTemplate(cur);
@ -202,26 +204,53 @@ 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
cur = cur->next;
continue;
}
if (xmlStrEqual(cur->name, "param")) {
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 ((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;
}
ret->content = template->children;
}

27
libxslt/xsltconfig.h.in Normal file
View File

@ -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__ */