mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
* parser.c: use options from current parser context when creating
a parser context within xmlParseCtxtExternalEntity * xmlwriter.c: fix error message when unable to create output file
This commit is contained in:
18
parser.c
18
parser.c
@@ -12068,27 +12068,11 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
|
||||
if (ctx->myDoc == NULL) /* @@ relax but check for dereferences */
|
||||
return(-1);
|
||||
|
||||
ctxt = xmlNewParserCtxt();
|
||||
ctxt = xmlCreateEntityParserCtxtInternal(URL, ID, NULL, ctx);
|
||||
if (ctxt == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
ctxt->userData = ctxt;
|
||||
ctxt->_private = ctx->_private;
|
||||
|
||||
inputStream = xmlLoadExternalEntity((char *)URL, (char *)ID, ctxt);
|
||||
if (inputStream == NULL) {
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
inputPush(ctxt, inputStream);
|
||||
|
||||
if ((ctxt->directory == NULL) && (directory == NULL))
|
||||
directory = xmlParserGetDirectory((char *)URL);
|
||||
if ((ctxt->directory == NULL) && (directory != NULL))
|
||||
ctxt->directory = directory;
|
||||
|
||||
oldsax = ctxt->sax;
|
||||
ctxt->sax = ctx->sax;
|
||||
xmlDetectSAX2(ctxt);
|
||||
|
||||
Reference in New Issue
Block a user