diff --git a/ChangeLog b/ChangeLog index 82dead9c..f3f11538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Oct 9 13:02:46 CEST 2001 Daniel Veillard + + * libxslt/documents.c libxslt/extra.c libxslt/transform.[ch]: + strip-space should also be applied to document imported + at run-time. + Tue Oct 9 12:36:53 CEST 2001 Daniel Veillard * libxslt/imports.[ch] libxslt/transform.c libxslt/xslt.c: diff --git a/libxslt/documents.c b/libxslt/documents.c index 9b2e8aa6..86771af6 100644 --- a/libxslt/documents.c +++ b/libxslt/documents.c @@ -17,6 +17,8 @@ #include "xsltInternals.h" #include "xsltutils.h" #include "documents.h" +#include "transform.h" +#include "imports.h" #include "keys.h" #ifdef LIBXML_XINCLUDE_ENABLED @@ -173,6 +175,12 @@ xsltLoadDocument(xsltTransformContextPtr ctxt, const xmlChar *URI) { URI); #endif } + /* + * Apply white-space stripping if asked for + */ + if (xsltNeedElemSpaceHandling(ctxt)) + xsltApplyStripSpaces(ctxt, xmlDocGetRootElement(doc)); + ret = xsltNewDocument(ctxt, doc); return(ret); } diff --git a/libxslt/extra.c b/libxslt/extra.c index 9ced4370..12329580 100644 --- a/libxslt/extra.c +++ b/libxslt/extra.c @@ -227,7 +227,7 @@ xsltFunctionExpression(xmlXPathParserContextPtr ctxt, int nargs){ tctxt = xsltXPathGetTransformContext(ctxt); comp = xmlXPathCompile(obj->stringval); if(comp != NULL) { - ret = xmlXPathNewCString(obj->stringval); + ret = xmlXPathNewString(obj->stringval); ret->user = comp; valuePush(ctxt, ret); } diff --git a/libxslt/transform.c b/libxslt/transform.c index a18e404a..c793292a 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -3058,7 +3058,7 @@ xsltGetHTMLIDs(const xmlChar *version, const xmlChar **public, * * Strip the unwanted ignorable spaces from the input tree */ -static void +void xsltApplyStripSpaces(xsltTransformContextPtr ctxt, xmlNodePtr node) { xmlNodePtr current; #ifdef WITH_XSLT_DEBUG_PROCESS diff --git a/libxslt/transform.h b/libxslt/transform.h index d8ab3a23..9840622f 100644 --- a/libxslt/transform.h +++ b/libxslt/transform.h @@ -40,6 +40,8 @@ xmlDocPtr xsltApplyStylesheetUser (xsltStylesheetPtr style, /** * Private Interfaces */ +void xsltApplyStripSpaces (xsltTransformContextPtr ctxt, + xmlNodePtr node); xsltTransformFunction xsltExtElementLookup (xsltTransformContextPtr ctxt, const xmlChar *name,