1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

Wilfried Teiken provided a hackish but working way to get context reported

* parser.c: Wilfried Teiken provided a hackish but working
  way to get context reported back on entities when parsing
  with SAX and without breaking the DOM build.
Daniel
This commit is contained in:
Daniel Veillard 2002-03-18 11:45:56 +00:00
parent 1eb242413e
commit b5a60eccfd
2 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,9 @@
Mon Mar 18 12:44:23 CET 2002 Daniel Veillard <daniel@veillard.com>
* parser.c: Wilfried Teiken provided a hackish but working
way to get context reported back on entities when parsing
with SAX and without breaking the DOM build.
Sun Mar 17 11:31:55 CET 2002 Daniel Veillard <daniel@veillard.com>
* c14n.c: applied a new patch from Aleksey Sanin

View File

@ -5251,17 +5251,29 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
* if its replacement text matches the production labeled
* content.
*/
void *user_data;
/*
* This is a bit hackish but this seems the best
* way to make sure both SAX and DOM entity support
* behaves okay.
*/
if (ctxt->userData == ctxt)
user_data = NULL;
else
user_data = ctxt->userData;
if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) {
ctxt->depth++;
ret = xmlParseBalancedChunkMemory(ctxt->myDoc,
ctxt->sax, NULL, ctxt->depth,
ctxt->sax, user_data, ctxt->depth,
value, &list);
ctxt->depth--;
} else if (ent->etype ==
XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
ctxt->depth++;
ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt,
ctxt->sax, NULL, ctxt->depth,
ctxt->sax, user_data, ctxt->depth,
ent->URI, ent->ExternalID, &list);
ctxt->depth--;
} else {