1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-10 14:40:58 +03:00

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
This commit is contained in:
Daniel Veillard
2005-03-30 12:12:53 +00:00
parent 71ea287919
commit 23936b6bb8
12 changed files with 83 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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)

2
tests/xinclude/e.xml Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0"?>
<e/>

14
tests/xinclude/e.xsl Normal file
View File

@ -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>

View File

@ -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>

5
tests/xinclude/x1.xml Normal file
View File

@ -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>

4
tests/xinclude/x2.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<foo>
<element>x2</element>
</foo>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<foo>
<element>x1</element>
<foo>
<element>x2</element>
</foo>
</foo>

View File

@ -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);