summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--configure.in1
-rw-r--r--libxslt/xsltwin32config.h2
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/xinclude/Makefile.am33
-rw-r--r--tests/xinclude/e.xml2
-rw-r--r--tests/xinclude/e.xsl14
-rw-r--r--tests/xinclude/normal.out5
-rw-r--r--tests/xinclude/x1.xml5
-rw-r--r--tests/xinclude/x2.xml4
-rw-r--r--tests/xinclude/xinclude.out7
-rw-r--r--xsltproc/xsltproc.c2
12 files changed, 83 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 942261b8..18802f08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 30 14:09:19 CEST 2005 Daniel Veillard <daniel@veillard.com>
+
+ * 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 <daniel@veillard.com>
* libxslt/pattern.c: fixed bug 169718 with ancestors in patterns
diff --git a/configure.in b/configure.in
index d3328e47..5ce36de7 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 f4864cde..4e228a19 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 7a13048e..fb0fd559 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 00000000..60009df3
--- /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 00000000..a3ab3879
--- /dev/null
+++ b/tests/xinclude/e.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<e/>
diff --git a/tests/xinclude/e.xsl b/tests/xinclude/e.xsl
new file mode 100644
index 00000000..eb56f0f1
--- /dev/null
+++ b/tests/xinclude/e.xsl
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+version="1.0">
+
+ <xsl:template match="/">
+ <xsl:apply-templates select="document('x1.xml')/foo"/>
+ </xsl:template>
+
+ <xsl:template match="*|@*|text()">
+ <xsl:copy><xsl:apply-templates select="*|@*|
+text()" /></xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/tests/xinclude/normal.out b/tests/xinclude/normal.out
new file mode 100644
index 00000000..b7f37c04
--- /dev/null
+++ b/tests/xinclude/normal.out
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<foo>
+ <element>x1</element>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="x2.xml"/>
+</foo>
diff --git a/tests/xinclude/x1.xml b/tests/xinclude/x1.xml
new file mode 100644
index 00000000..a64b15b2
--- /dev/null
+++ b/tests/xinclude/x1.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<foo>
+ <element>x1</element>
+ <xi:include href="x2.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+</foo>
diff --git a/tests/xinclude/x2.xml b/tests/xinclude/x2.xml
new file mode 100644
index 00000000..6a319d11
--- /dev/null
+++ b/tests/xinclude/x2.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<foo>
+ <element>x2</element>
+</foo>
diff --git a/tests/xinclude/xinclude.out b/tests/xinclude/xinclude.out
new file mode 100644
index 00000000..046d0db8
--- /dev/null
+++ b/tests/xinclude/xinclude.out
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<foo>
+ <element>x1</element>
+ <foo>
+ <element>x2</element>
+</foo>
+</foo>
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index 244826f1..10cae258 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);