mirror of
https://gitlab.gnome.org/GNOME/libxslt
synced 2025-08-08 21:42:07 +03:00
added and tested the --path option to close #79638 Daniel
* xsltproc: added and tested the --path option to close #79638 Daniel
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
Thu Oct 17 15:50:04 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xsltproc: added and tested the --path option to close #79638
|
||||||
|
|
||||||
Thu Oct 17 15:25:46 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
Thu Oct 17 15:25:46 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* libxslt/attributes.c: fixing bug #95826 the attribute was reset
|
* libxslt/attributes.c: fixing bug #95826 the attribute was reset
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "libxslt/libxslt.h"
|
#include "libxslt/libxslt.h"
|
||||||
#include "libexslt/exslt.h"
|
#include "libexslt/exslt.h"
|
||||||
|
#include <stdio.h>
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -150,31 +151,49 @@ xmlExternalEntityLoader defaultEntityLoader = NULL;
|
|||||||
|
|
||||||
static xmlParserInputPtr
|
static xmlParserInputPtr
|
||||||
xsltprocExternalEntityLoader(const char *URL, const char *ID,
|
xsltprocExternalEntityLoader(const char *URL, const char *ID,
|
||||||
xmlParserCtxtPtr context) {
|
xmlParserCtxtPtr ctxt) {
|
||||||
xmlParserInputPtr ret;
|
xmlParserInputPtr ret;
|
||||||
xmlURIPtr uri;
|
warningSAXFunc warning = NULL;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if ((ctxt != NULL) && (ctxt->sax != NULL)) {
|
||||||
|
warning = ctxt->sax->warning;
|
||||||
|
ctxt->sax->warning = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (defaultEntityLoader != NULL) {
|
if (defaultEntityLoader != NULL) {
|
||||||
ret = defaultEntityLoader(URL, ID, context);
|
ret = defaultEntityLoader(URL, ID, ctxt);
|
||||||
if (ret != NULL)
|
if (ret != NULL) {
|
||||||
|
if (warning != NULL)
|
||||||
|
ctxt->sax->warning = warning;
|
||||||
return(ret);
|
return(ret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (i = 0;i < nbpaths;i++) {
|
for (i = 0;i < nbpaths;i++) {
|
||||||
xmlChar *newURL;
|
xmlChar *newURL;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = xmlStrlen(paths[i]) + xmlStrlen(URL) + 5;
|
len = xmlStrlen(paths[i]) + xmlStrlen(BAD_CAST URL) + 5;
|
||||||
newURL = xmlMalloc(len);
|
newURL = xmlMalloc(len);
|
||||||
if (newURL != NULL) {
|
if (newURL != NULL) {
|
||||||
snprintf(newURL, len, "%s/%s", paths[i], URL);
|
snprintf(newURL, len, "%s/%s", paths[i], URL);
|
||||||
ret = defaultEntityLoader((const char *)newURL, ID, context);
|
ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
|
||||||
xmlFree(newURL);
|
xmlFree(newURL);
|
||||||
if (ret != NULL)
|
if (ret != NULL) {
|
||||||
|
if (warning != NULL)
|
||||||
|
ctxt->sax->warning = warning;
|
||||||
return(ret);
|
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);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user