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

- parser.c: fixed propagation context info when parsing an

external entity.
- doc/html/*.html: regenerated a couple of docs
Daniel
This commit is contained in:
Daniel Veillard
2001-05-20 13:19:52 +00:00
parent 4623acdc4f
commit a97a19b687
2 changed files with 32 additions and 17 deletions

View File

@ -1,3 +1,9 @@
Sun May 20 15:15:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* parser.c: fixed propagation context info when parsing an
external entity.
* doc/html/*.html: regenerated a couple of docs
Sat May 19 17:11:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr> Sat May 19 17:11:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* doc/xml.html: update with 2.3.9 informations * doc/xml.html: update with 2.3.9 informations

View File

@ -110,9 +110,10 @@ xmlEntityPtr xmlParseStringPEReference(xmlParserCtxtPtr ctxt,
const xmlChar **str); const xmlChar **str);
static int static int
xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax, xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
xmlSAXHandlerPtr sax,
void *user_data, int depth, const xmlChar *URL, void *user_data, int depth, const xmlChar *URL,
const xmlChar *ID, xmlNodePtr *list, void *private); const xmlChar *ID, xmlNodePtr *list);
/************************************************************************ /************************************************************************
* * * *
@ -5004,10 +5005,9 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
} else if (ent->etype == } else if (ent->etype ==
XML_EXTERNAL_GENERAL_PARSED_ENTITY) { XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
ctxt->depth++; ctxt->depth++;
ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt,
ctxt->sax, NULL, ctxt->depth, ctxt->sax, NULL, ctxt->depth,
ent->URI, ent->ExternalID, &list, ent->URI, ent->ExternalID, &list);
ctxt->_private);
ctxt->depth--; ctxt->depth--;
} else { } else {
ret = -1; ret = -1;
@ -8928,13 +8928,13 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
/** /**
* xmlParseExternalEntityPrivate: * xmlParseExternalEntityPrivate:
* @doc: the document the chunk pertains to * @doc: the document the chunk pertains to
* @oldctxt: the previous parser context if available
* @sax: the SAX handler bloc (possibly NULL) * @sax: the SAX handler bloc (possibly NULL)
* @user_data: The user data returned on SAX callbacks (possibly NULL) * @user_data: The user data returned on SAX callbacks (possibly NULL)
* @depth: Used for loop detection, use 0 * @depth: Used for loop detection, use 0
* @URL: the URL for the entity to load * @URL: the URL for the entity to load
* @ID: the System ID for the entity to load * @ID: the System ID for the entity to load
* @list: the return value for the set of parsed nodes * @list: the return value for the set of parsed nodes
* @private: extra field for the _private parser context
* *
* Private version of xmlParseExternalEntity() * Private version of xmlParseExternalEntity()
* *
@ -8943,9 +8943,10 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
*/ */
static int static int
xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax, xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
xmlSAXHandlerPtr sax,
void *user_data, int depth, const xmlChar *URL, void *user_data, int depth, const xmlChar *URL,
const xmlChar *ID, xmlNodePtr *list, void *private) { const xmlChar *ID, xmlNodePtr *list) {
xmlParserCtxtPtr ctxt; xmlParserCtxtPtr ctxt;
xmlDocPtr newDoc; xmlDocPtr newDoc;
xmlSAXHandlerPtr oldsax = NULL; xmlSAXHandlerPtr oldsax = NULL;
@ -8968,7 +8969,21 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax,
ctxt = xmlCreateEntityParserCtxt(URL, ID, NULL); ctxt = xmlCreateEntityParserCtxt(URL, ID, NULL);
if (ctxt == NULL) return(-1); if (ctxt == NULL) return(-1);
ctxt->userData = ctxt; ctxt->userData = ctxt;
ctxt->_private = private; if (oldctxt != NULL) {
ctxt->_private = oldctxt->_private;
ctxt->loadsubset = oldctxt->loadsubset;
ctxt->validate = oldctxt->validate;
ctxt->external = oldctxt->external;
} else {
/*
* Doing validity checking on chunk without context
* doesn't make sense
*/
ctxt->_private = NULL;
ctxt->validate = 0;
ctxt->external = 2;
ctxt->loadsubset = 0;
}
if (sax != NULL) { if (sax != NULL) {
oldsax = ctxt->sax; oldsax = ctxt->sax;
ctxt->sax = sax; ctxt->sax = sax;
@ -9015,13 +9030,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax,
xmlParseTextDecl(ctxt); xmlParseTextDecl(ctxt);
} }
/*
* Doing validity checking on chunk doesn't make sense
*/
ctxt->instate = XML_PARSER_CONTENT; ctxt->instate = XML_PARSER_CONTENT;
ctxt->validate = 0;
ctxt->external = 2;
ctxt->loadsubset = 0;
ctxt->depth = depth; ctxt->depth = depth;
xmlParseContent(ctxt); xmlParseContent(ctxt);
@ -9106,8 +9115,8 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlSAXHandlerPtr sax,
int int
xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list) { int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list) {
return(xmlParseExternalEntityPrivate(doc, sax, user_data, depth, URL, return(xmlParseExternalEntityPrivate(doc, NULL, sax, user_data, depth, URL,
ID, list, NULL)); ID, list));
} }
/** /**