From: Daniel Veillard Date: Sat, 16 Nov 2002 22:26:08 +0000 (+0000) Subject: make sure to register EXSLT for the bindings add a specific test minor X-Git-Tag: v1.1.28~807 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccc85690128fd0cdd9dae9781b89653255ade2e8;p=platform%2Fupstream%2Flibxslt.git make sure to register EXSLT for the bindings add a specific test minor * python/libxslt.c: make sure to register EXSLT for the bindings * python/tests/Makefile.am python/tests/exslt.py: add a specific test * xsltproc/xsltproc.c: minor cleanup Daniel --- diff --git a/ChangeLog b/ChangeLog index 9b41e5e..c529e7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Nov 16 23:23:41 CET 2002 Daniel Veillard + + * python/libxslt.c: make sure to register EXSLT for the bindings + * python/tests/Makefile.am python/tests/exslt.py: add a specific test + * xsltproc/xsltproc.c: minor cleanup + Fri Nov 15 12:35:57 CET 2002 Daniel Veillard * python/Makefile.am python/tests/Makefile.am: trying to fix #98518 diff --git a/python/libxslt.c b/python/libxslt.c index 9ab20f8..7b115a6 100644 --- a/python/libxslt.c +++ b/python/libxslt.c @@ -458,6 +458,10 @@ void initlibxsltmod(void) { xmlInitMemory(); xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; xmlDefaultSAXHandler.cdataBlock = NULL; + /* + * Register the EXSLT extensions and the test module + */ + exsltRegisterAll(); } diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index 0e6cf72..cb7a2f1 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -2,6 +2,7 @@ EXAMPLE_DIR = $(datadir)/doc/libxslt-python-$(LIBXSLT_VERSION)/examples TESTSPY= \ basic.py \ + exslt.py \ extfunc.py XMLS= \ diff --git a/python/tests/exslt.py b/python/tests/exslt.py new file mode 100755 index 0000000..5432347 --- /dev/null +++ b/python/tests/exslt.py @@ -0,0 +1,57 @@ +#!/usr/bin/python -u +import sys +import libxml2 +import libxslt + +# Memory debug specific +libxml2.debugMemory(1) + + +styledoc = libxml2.parseDoc( +""" + + + +; + str:tokenize('2001-06-03T11:40:23', '-T:') + ; + + str:tokenize('date math str') + ; + + + + +""") +style = libxslt.parseStylesheetDoc(styledoc) +doc = libxml2.parseDoc("") +result = style.applyStylesheet(doc, None) +stringval = style.saveResultToString(result) +style.freeStylesheet() +doc.freeDoc() +result.freeDoc() + +expect=""" +; + str:tokenize('2001-06-03T11:40:23', '-T:') + 20010603114023; + + str:tokenize('date math str') + datemathstr; + +""" + +if stringval != expect: + print "Exslt processing failed" + sys.exit(255) + +# Memory debug specific +libxslt.cleanup() +if libxml2.debugMemory(1) == 0: + print "OK" +else: + print "Memory leak %d bytes" % (libxml2.debugMemory(1)) + libxml2.dumpMemory() diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index a4e2e90..fe1e258 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -172,7 +172,6 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID, } for (i = 0;i < nbpaths;i++) { xmlChar *newURL; - int len; newURL = xmlStrdup((const xmlChar *) paths[i]); newURL = xmlStrcat(newURL, (const xmlChar *) "/");