version 1.76, 2000/08/29 23:37:07
|
version 1.77, 2000/09/10 16:01:05
|
Line 311 xmlParserInputPtr
|
Line 311 xmlParserInputPtr
|
resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId) |
resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId) |
{ |
{ |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; |
|
xmlParserInputPtr ret; |
|
char *URI; |
|
const char *base = NULL; |
|
|
|
if (ctxt->input != NULL) |
|
base = ctxt->input->filename; |
|
if (base == NULL) |
|
base = ctxt->directory; |
|
|
|
URI = xmlBuildURI(systemId, base); |
|
|
#ifdef DEBUG_SAX |
#ifdef DEBUG_SAX |
fprintf(stderr, "SAX.resolveEntity(%s, %s)\n", publicId, systemId); |
fprintf(stderr, "SAX.resolveEntity(%s, %s)\n", publicId, systemId); |
#endif |
#endif |
|
|
return(xmlLoadExternalEntity((const char *) systemId, |
ret = xmlLoadExternalEntity((const char *) URI, |
(const char *) publicId, ctxt)); |
(const char *) publicId, ctxt); |
|
if (URI != NULL) |
|
xmlFree(URI); |
|
return(ret); |
} |
} |
|
|
/** |
/** |
Line 409 entityDecl(void *ctx, const xmlChar *nam
|
Line 422 entityDecl(void *ctx, const xmlChar *nam
|
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) |
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) |
ctxt->sax->warning(ctxt, |
ctxt->sax->warning(ctxt, |
"Entity(%s) already defined in the internal subset\n", name); |
"Entity(%s) already defined in the internal subset\n", name); |
|
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) { |
|
char *URI; |
|
const char *base = NULL; |
|
|
|
if (ctxt->input != NULL) |
|
base = ctxt->input->filename; |
|
if (base == NULL) |
|
base = ctxt->directory; |
|
|
|
URI = xmlBuildURI(systemId, base); |
|
ent->URI = URI; |
|
} |
} else if (ctxt->inSubset == 2) { |
} else if (ctxt->inSubset == 2) { |
ent = xmlAddDtdEntity(ctxt->myDoc, name, type, publicId, |
ent = xmlAddDtdEntity(ctxt->myDoc, name, type, publicId, |
systemId, content); |
systemId, content); |
Line 416 entityDecl(void *ctx, const xmlChar *nam
|
Line 441 entityDecl(void *ctx, const xmlChar *nam
|
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) |
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL)) |
ctxt->sax->warning(ctxt, |
ctxt->sax->warning(ctxt, |
"Entity(%s) already defined in the external subset\n", name); |
"Entity(%s) already defined in the external subset\n", name); |
|
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) { |
|
char *URI; |
|
const char *base = NULL; |
|
|
|
if (ctxt->input != NULL) |
|
base = ctxt->input->filename; |
|
if (base == NULL) |
|
base = ctxt->directory; |
|
|
|
URI = xmlBuildURI(systemId, base); |
|
ent->URI = URI; |
|
} |
} else { |
} else { |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) |
ctxt->sax->error(ctxt, |
ctxt->sax->error(ctxt, |