mirror of
https://github.com/GNOME/libxml2.git
synced 2025-02-23 18:29:14 +08: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:
parent
1eb242413e
commit
b5a60eccfd
@ -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
|
||||
|
16
parser.c
16
parser.c
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user