1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

- xmlIO.c catalog.c: plugged in the default catalog resolution

- doc/gnome-xml.sgml: linked in the Docbook parser and catalog
  documentations
- doc/html/libxml-*.html: rebuild added the missing ones to CVS
Daniel
This commit is contained in:
Daniel Veillard
2001-05-10 15:34:11 +00:00
parent a737459bc4
commit 7d6fd219f2
17 changed files with 4097 additions and 281 deletions

25
xmlIO.c
View File

@ -65,6 +65,9 @@
#include <libxml/nanohttp.h>
#include <libxml/nanoftp.h>
#include <libxml/xmlerror.h>
#ifdef LIBXML_CATALOG_ENABLED
#include <libxml/catalog.h>
#endif
#ifdef VMS
#define xmlRegisterDefaultInputCallbacks xmlRegisterDefInputCallbacks
@ -1587,12 +1590,26 @@ xmlParserInputPtr
xmlDefaultExternalEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlParserInputPtr ret = NULL;
const xmlChar *resource = NULL;
#ifdef DEBUG_EXTERNAL_ENTITIES
xmlGenericError(xmlGenericErrorContext,
"xmlDefaultExternalEntityLoader(%s, xxx)\n", URL);
#endif
if (URL == NULL) {
#ifdef LIBXML_CATALOG_ENABLED
/*
* Try to load it from the resource pointed in the catalog
*/
if (ID != NULL)
resource = xmlCatalogGetPublic((const xmlChar *)ID);
if ((resource == NULL) && (URL != NULL))
resource = xmlCatalogGetSystem((const xmlChar *)URL);
#endif
if (resource == NULL)
resource = (const xmlChar *)URL;
if (resource == NULL) {
if ((ctxt->validate) && (ctxt->sax != NULL) &&
(ctxt->sax->error != NULL))
ctxt->sax->error(ctxt,
@ -1602,15 +1619,15 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID,
"failed to load external entity \"%s\"\n", ID);
return(NULL);
}
ret = xmlNewInputFromFile(ctxt, URL);
ret = xmlNewInputFromFile(ctxt, (const char *)resource);
if (ret == NULL) {
if ((ctxt->validate) && (ctxt->sax != NULL) &&
(ctxt->sax->error != NULL))
ctxt->sax->error(ctxt,
"failed to load external entity \"%s\"\n", URL);
"failed to load external entity \"%s\"\n", resource);
else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
ctxt->sax->warning(ctxt,
"failed to load external entity \"%s\"\n", URL);
"failed to load external entity \"%s\"\n", resource);
}
return(ret);
}