diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | libxslt/transform.c | 10 | ||||
-rw-r--r-- | tests/REC/Makefile.am | 62 | ||||
-rw-r--r-- | tests/general/Makefile.am | 32 | ||||
-rw-r--r-- | xsltproc/xsltproc.c | 6 |
5 files changed, 119 insertions, 0 deletions
@@ -1,3 +1,12 @@ +Tue Mar 29 21:06:11 CEST 2005 Daniel Veillard <daniel@veillard.com> + + * libxslt/transform.c: working around Mark Vakoc' reported bug related + to mode internaing + * xsltproc/xsltproc.c: adding a --nodict mode to check problems with + document without a dictionnary. + * tests/REC/Makefile.am tests/general/Makefile.am: testing without + dictionnary + Tue Mar 29 15:37:13 CEST 2005 Daniel Veillard <daniel@veillard.com> * libxslt/xslt.c: fix bug #165201 when calling xsltInit() multiple diff --git a/libxslt/transform.c b/libxslt/transform.c index ee469807..7e3f33ad 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -4053,6 +4053,16 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc, else ctxt->outputFile = NULL; + /* + * internalize the modes if needed + */ + if (ctxt->dict != NULL) { + if (ctxt->mode != NULL) + ctxt->mode = xmlDictLookup(ctxt->dict, ctxt->mode, -1); + if (ctxt->modeURI != NULL) + ctxt->modeURI = xmlDictLookup(ctxt->dict, ctxt->modeURI, -1); + } + XSLT_GET_IMPORT_PTR(method, style, method) XSLT_GET_IMPORT_PTR(doctypePublic, style, doctypePublic) XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem) diff --git a/tests/REC/Makefile.am b/tests/REC/Makefile.am index bc2c10a7..1b42cbd8 100644 --- a/tests/REC/Makefile.am +++ b/tests/REC/Makefile.am @@ -142,4 +142,66 @@ test tests: $(top_builddir)/xsltproc/xsltproc fi ; \ rm -f $$name.res $$name.bad ; \ done) + @echo '## Running REC tests without dictionaries' + -@(for i in $(srcdir)/*.xsl ; do \ + name=`basename $$i .xsl` ; \ + if [ ! -f $(srcdir)/$$name.xml ] ; then \ + continue ; \ + fi ; \ + log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc --nodict \ + $(srcdir)/$$name.xsl $(srcdir)/$$name.xml \ + > $$name.res 2>$$name.bad ; \ + if [ ! -f $(srcdir)/$$name.out ] ; then \ + cp $$name.res $(srcdir)/$$name.out ; \ + if [ -s $$name.bad ] ; then \ + cp $$name.bad $(srcdir)/$$name.err ; \ + fi ; \ + else \ + if [ ! -s $$name.res ] ; then \ + echo "Fatal error, no $$name.res\n" ; \ + else \ + diff $(srcdir)/$$name.out $$name.res ; \ + if [ -s $$name.err ] ; then \ + diff $(srcdir)/$$name.err $$name.bad ; \ + else \ + diff /dev/null $$name.bad ; \ + fi ; \ + fi ; \ + fi ; \ + grep "MORY ALLO" .memdump | \ + grep -v "MEMORY ALLOCATED : 0" || true` ; \ + if [ -n "$$log" ] ; then \ + echo $$name result ; \ + echo $$log ; \ + fi ; \ + rm -f $$name.res $$name.bad ; \ + done) + @(for i in $(srcdir)/stand*.xml ; do \ + name=`basename $$i .xml` ; \ + log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc --nodict \ + $(srcdir)/$$name.xml > $$name.res 2>$$name.bad ;\ + if [ ! -f $(srcdir)/$$name.stand.out ] ; then \ + cp $$name.res $(srcdir)/$$name.stand.out ; \ + if [ -s $$name.bad ] ; then \ + cp $$name.bad $(srcdir)/$$name.stand.err ; \ + fi ; \ + else \ + if [ ! -s $$name.res ] ; then \ + echo "Fatal error, no $$name.res\n" ; \ + else \ + diff $(srcdir)/$$name.stand.out $$name.res ; \ + if [ -s $$name.stand.err ] ; then \ + diff $(srcdir)/$$name.stand.err $$name.bad ; \ + else \ + diff /dev/null $$name.bad; \ + fi ; \ + fi ; \ + fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true` ; \ + if [ -n "$$log" ] ; then \ + echo $$name result ; \ + echo $$log ; \ + fi ; \ + rm -f $$name.res $$name.bad ; \ + done) diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 25747fbc..785e511c 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -213,4 +213,36 @@ test tests: $(top_builddir)/xsltproc/xsltproc fi ; \ rm -f result.$$name err.$$name; \ done ; done) + @echo '## Running general tests without dictionaries' + -@(for i in $(srcdir)/../docs/*.xml ; do \ + if [ -d $$i ] ; then continue ; fi ; \ + doc=`basename $$i .xml` ; \ + for j in $(srcdir)/$$doc*.xsl ; do \ + if [ ! -f $$j ] ; then continue ; fi ; \ + if [ -d $$j ] ; then continue ; fi ; \ + name=`basename $$j .xsl`; \ + out=$(srcdir)/"$$name".out; \ + err=$(srcdir)/"$$name".err; \ + log=`$(CHECKER) $(top_builddir)/xsltproc/xsltproc --nodict $$j $$i \ + > result.$$name 2>err.$$name; \ + if [ ! -f $$out ] ; then \ + cp result.$$name $$out ; \ + if [ -s err.$$name ] ; then \ + cp err.$$name $$err ; \ + fi ; \ + else \ + diff $$out result.$$name; \ + if [ -s $$err ] ; then \ + diff $$err err.$$name; \ + else \ + diff /dev/null err.$$name; \ + fi ; \ + fi ; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true`;\ + if [ -n "$$log" ] ; then \ + echo $$name result ; \ + echo $$log ; \ + fi ; \ + rm -f result.$$name err.$$name; \ + done ; done) diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index b53b5e2d..244826f1 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -82,6 +82,7 @@ static int dumpextensions = 0; static int novalid = 0; static int nodtdattr = 0; static int noout = 0; +static int nodict = 0; #ifdef LIBXML_HTML_ENABLED static int html = 0; #endif @@ -604,6 +605,9 @@ main(int argc, char **argv) } else if ((!strcmp(argv[i], "-profile")) || (!strcmp(argv[i], "--profile"))) { profile++; + } else if ((!strcmp(argv[i], "-nodict")) || + (!strcmp(argv[i], "--nodict"))) { + nodict++; } else if ((!strcmp(argv[i], "-norman")) || (!strcmp(argv[i], "--norman"))) { profile++; @@ -725,6 +729,8 @@ main(int argc, char **argv) options = XML_PARSE_NOENT | XML_PARSE_NOCDATA; else if (nodtdattr) options = XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_NOCDATA; + if (nodict != 0) + options |= XML_PARSE_NODICT; /* * Register the EXSLT extensions and the test module |