From 23936b6bb80423e75c42f7cf82deaf458d88f0ca Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 30 Mar 2005 12:12:53 +0000 Subject: [PATCH] fixed the xinclude problem with document() as in bug #171893 added a new * xsltproc/xsltproc.c: fixed the xinclude problem with document() as in bug #171893 * configure.in tests/Makefile.am tests/xinclude/*: added a new xinclude directory with the test for this problem Daniel --- ChangeLog | 7 +++++++ configure.in | 1 + libxslt/xsltwin32config.h | 2 +- tests/Makefile.am | 3 ++- tests/xinclude/Makefile.am | 33 +++++++++++++++++++++++++++++++++ tests/xinclude/e.xml | 2 ++ tests/xinclude/e.xsl | 14 ++++++++++++++ tests/xinclude/normal.out | 5 +++++ tests/xinclude/x1.xml | 5 +++++ tests/xinclude/x2.xml | 4 ++++ tests/xinclude/xinclude.out | 7 +++++++ xsltproc/xsltproc.c | 2 ++ 12 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 tests/xinclude/Makefile.am create mode 100644 tests/xinclude/e.xml create mode 100644 tests/xinclude/e.xsl create mode 100644 tests/xinclude/normal.out create mode 100644 tests/xinclude/x1.xml create mode 100644 tests/xinclude/x2.xml create mode 100644 tests/xinclude/xinclude.out diff --git a/ChangeLog b/ChangeLog index 942261b..18802f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Mar 30 14:09:19 CEST 2005 Daniel Veillard + + * xsltproc/xsltproc.c: fixed the xinclude problem with document() + as in bug #171893 + * configure.in tests/Makefile.am tests/xinclude/*: added a new + xinclude directory with the test for this problem + Wed Mar 30 11:59:06 CEST 2005 Daniel Veillard * libxslt/pattern.c: fixed bug 169718 with ancestors in patterns diff --git a/configure.in b/configure.in index d3328e4..5ce36de 100644 --- a/configure.in +++ b/configure.in @@ -573,6 +573,7 @@ tests/numbers/Makefile tests/documents/Makefile tests/xmlspec/Makefile tests/multiple/Makefile +tests/xinclude/Makefile tests/XSLTMark/Makefile tests/docbook/Makefile tests/exslt/Makefile diff --git a/libxslt/xsltwin32config.h b/libxslt/xsltwin32config.h index f4864cd..4e228a1 100644 --- a/libxslt/xsltwin32config.h +++ b/libxslt/xsltwin32config.h @@ -44,7 +44,7 @@ extern "C" { * * extra version information, used to show a CVS compilation */ -#define LIBXSLT_VERSION_EXTRA "-CVS999" +#define LIBXSLT_VERSION_EXTRA "-CVS1006" /** * WITH_XSLT_DEBUG: diff --git a/tests/Makefile.am b/tests/Makefile.am index 7a13048..fb0fd55 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,8 @@ ## Process this file with automake to produce Makefile.in SUBDIRS=docs REC1 REC2 REC general namespaces keys numbers documents \ - extensions reports xmlspec multiple XSLTMark docbook exslt plugins + extensions reports xmlspec multiple xinclude XSLTMark docbook \ + exslt plugins all: diff --git a/tests/xinclude/Makefile.am b/tests/xinclude/Makefile.am new file mode 100644 index 0000000..60009df --- /dev/null +++ b/tests/xinclude/Makefile.am @@ -0,0 +1,33 @@ +## Process this file with automake to produce Makefile.in + +$(top_builddir)/xsltproc/xsltproc: + @(cd ../../xsltproc ; $(MAKE) xsltproc) + +EXTRA_DIST = \ + e.xml \ + e.xsl \ + x1.xml \ + x2.xml \ + normal.out \ + xinclude.out + +all: + +valgrind: + @echo '## Running the regression tests under Valgrind' + $(MAKE) CHECKER='valgrind -q' tests + +test tests: $(top_builddir)/xsltproc/xsltproc + @echo '## Running XInclude test' + @(echo > .memdump) + @($(CHECKER) $(top_builddir)/xsltproc/xsltproc $(srcdir)/e.xsl $(srcdir)/e.xml > res ; \ + diff $(srcdir)/normal.out res; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ + rm -f res) + @($(CHECKER) $(top_builddir)/xsltproc/xsltproc --xinclude $(srcdir)/e.xsl $(srcdir)/e.xml > res ; \ + diff $(srcdir)/xinclude.out res; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ + rm -f res) + + + diff --git a/tests/xinclude/e.xml b/tests/xinclude/e.xml new file mode 100644 index 0000000..a3ab387 --- /dev/null +++ b/tests/xinclude/e.xml @@ -0,0 +1,2 @@ + + diff --git a/tests/xinclude/e.xsl b/tests/xinclude/e.xsl new file mode 100644 index 0000000..eb56f0f --- /dev/null +++ b/tests/xinclude/e.xsl @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/tests/xinclude/normal.out b/tests/xinclude/normal.out new file mode 100644 index 0000000..b7f37c0 --- /dev/null +++ b/tests/xinclude/normal.out @@ -0,0 +1,5 @@ + + + x1 + + diff --git a/tests/xinclude/x1.xml b/tests/xinclude/x1.xml new file mode 100644 index 0000000..a64b15b --- /dev/null +++ b/tests/xinclude/x1.xml @@ -0,0 +1,5 @@ + + + x1 + + diff --git a/tests/xinclude/x2.xml b/tests/xinclude/x2.xml new file mode 100644 index 0000000..6a319d1 --- /dev/null +++ b/tests/xinclude/x2.xml @@ -0,0 +1,4 @@ + + + x2 + diff --git a/tests/xinclude/xinclude.out b/tests/xinclude/xinclude.out new file mode 100644 index 0000000..046d0db --- /dev/null +++ b/tests/xinclude/xinclude.out @@ -0,0 +1,7 @@ + + + x1 + + x2 + + diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index 244826f..10cae25 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -395,6 +395,8 @@ xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) { if (ctxt == NULL) return; xsltSetCtxtParseOptions(ctxt, options); + if (xinclude) + ctxt->xinclude = 1; if (profile) { res = xsltApplyStylesheetUser(cur, doc, params, NULL, stderr, ctxt); -- 2.7.4