diff --git a/ChangeLog b/ChangeLog index a1d230ed..b024bf2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Aug 24 16:44:41 CEST 2005 Daniel Veillard + + * parser.c: found another bug while looking at #309616 on missing + entities. + * result/ent2.sax* result/ent7.sax* result/xml2.sax*: this changed the + SAX stream in missing conditions for a few tests + Wed Aug 24 16:19:00 CEST 2005 Daniel Veillard * encoding.c: applied the patch suggested #309565 which can avoid diff --git a/parser.c b/parser.c index 3d810f03..44e61802 100644 --- a/parser.c +++ b/parser.c @@ -6100,6 +6100,11 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { } else { xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY, "Entity '%s' not defined\n", name); + if ((ctxt->inSubset == 0) && + (ctxt->sax != NULL) && + (ctxt->sax->reference != NULL)) { + ctxt->sax->reference(ctxt, name); + } } ctxt->valid = 0; } diff --git a/result/ent2.sax b/result/ent2.sax index 382bac19..07d2ce40 100644 --- a/result/ent2.sax +++ b/result/ent2.sax @@ -11,6 +11,7 @@ SAX.characters( , 3) SAX.getEntity(title) SAX.error: Entity 'title' not defined +SAX.reference(title) SAX.characters( This text is about XML, the, 31) SAX.getEntity(xml) diff --git a/result/ent2.sax2 b/result/ent2.sax2 index 8c28ea98..d7c80021 100644 --- a/result/ent2.sax2 +++ b/result/ent2.sax2 @@ -11,6 +11,7 @@ SAX.characters( , 3) SAX.getEntity(title) SAX.error: Entity 'title' not defined +SAX.reference(title) SAX.characters( This text is about XML, the, 31) SAX.getEntity(xml) diff --git a/result/ent7.sax b/result/ent7.sax index 0d5befa8..3228de3e 100644 --- a/result/ent7.sax +++ b/result/ent7.sax @@ -11,6 +11,7 @@ SAX.error: PEReference: %sampleEnt; not found SAX.characters('they called me , 16) SAX.getEntity(sampleEnt) SAX.error: Entity 'sampleEnt' not defined +SAX.reference(sampleEnt) SAX.characters(', 1) SAX.endDocument() xmlSAXUserParseFile returned error 27 diff --git a/result/ent7.sax2 b/result/ent7.sax2 index 0d5befa8..3228de3e 100644 --- a/result/ent7.sax2 +++ b/result/ent7.sax2 @@ -11,6 +11,7 @@ SAX.error: PEReference: %sampleEnt; not found SAX.characters('they called me , 16) SAX.getEntity(sampleEnt) SAX.error: Entity 'sampleEnt' not defined +SAX.reference(sampleEnt) SAX.characters(', 1) SAX.endDocument() xmlSAXUserParseFile returned error 27 diff --git a/result/xml2.sax b/result/xml2.sax index e8484733..141accd6 100644 --- a/result/xml2.sax +++ b/result/xml2.sax @@ -12,6 +12,7 @@ SAX.error: PEReference: %xx; not found SAX.characters(This sample shows a , 20) SAX.getEntity(tricky) SAX.error: Entity 'tricky' not defined +SAX.reference(tricky) SAX.characters( method., 8) SAX.endDocument() xmlSAXUserParseFile returned error 27 diff --git a/result/xml2.sax2 b/result/xml2.sax2 index e8484733..141accd6 100644 --- a/result/xml2.sax2 +++ b/result/xml2.sax2 @@ -12,6 +12,7 @@ SAX.error: PEReference: %xx; not found SAX.characters(This sample shows a , 20) SAX.getEntity(tricky) SAX.error: Entity 'tricky' not defined +SAX.reference(tricky) SAX.characters( method., 8) SAX.endDocument() xmlSAXUserParseFile returned error 27