diff --git a/ChangeLog b/ChangeLog index 04ab0452..bf9c7dd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Oct 17 15:50:04 CEST 2002 Daniel Veillard + + * xsltproc: added and tested the --path option to close #79638 + Thu Oct 17 15:25:46 CEST 2002 Daniel Veillard * libxslt/attributes.c: fixing bug #95826 the attribute was reset diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index 5022f33f..96d8cc1c 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -8,6 +8,7 @@ #include "libxslt/libxslt.h" #include "libexslt/exslt.h" +#include #ifdef HAVE_STRING_H #include #endif @@ -150,31 +151,49 @@ xmlExternalEntityLoader defaultEntityLoader = NULL; static xmlParserInputPtr xsltprocExternalEntityLoader(const char *URL, const char *ID, - xmlParserCtxtPtr context) { + xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret; - xmlURIPtr uri; + warningSAXFunc warning = NULL; int i; + if ((ctxt != NULL) && (ctxt->sax != NULL)) { + warning = ctxt->sax->warning; + ctxt->sax->warning = NULL; + } + if (defaultEntityLoader != NULL) { - ret = defaultEntityLoader(URL, ID, context); - if (ret != NULL) + ret = defaultEntityLoader(URL, ID, ctxt); + if (ret != NULL) { + if (warning != NULL) + ctxt->sax->warning = warning; return(ret); + } } for (i = 0;i < nbpaths;i++) { xmlChar *newURL; int len; - len = xmlStrlen(paths[i]) + xmlStrlen(URL) + 5; + len = xmlStrlen(paths[i]) + xmlStrlen(BAD_CAST URL) + 5; newURL = xmlMalloc(len); if (newURL != NULL) { snprintf(newURL, len, "%s/%s", paths[i], URL); - ret = defaultEntityLoader((const char *)newURL, ID, context); + ret = defaultEntityLoader((const char *)newURL, ID, ctxt); xmlFree(newURL); - if (ret != NULL) + if (ret != NULL) { + if (warning != NULL) + ctxt->sax->warning = warning; return(ret); + } } } + if (warning != NULL) { + ctxt->sax->warning = warning; + if (URL != NULL) + warning(ctxt, "failed to load external entity \"%s\"\n", URL); + else if (ID != NULL) + warning(ctxt, "failed to load external entity \"%s\"\n", ID); + } return(NULL); }