mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-30 22:43:14 +03:00
fixed bug #121210 (callback to sax->error, sax->warning with wrong
* SAX2.c, xmlIO.c: fixed bug #121210 (callback to sax->error, sax->warning with wrong params).
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Sat Sep 6 10:55:01 PTD 2003 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
|
* SAX2.c, xmlIO.c: fixed bug #121210 (callback to sax->error,
|
||||||
|
sax->warning with wrong params).
|
||||||
|
|
||||||
Fri Sep 5 10:33:42 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
Fri Sep 5 10:33:42 CEST 2003 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* include/libxml/globals.h: patch from St<53>phane Bidoul to export
|
* include/libxml/globals.h: patch from St<53>phane Bidoul to export
|
||||||
|
36
SAX2.c
36
SAX2.c
@ -366,8 +366,8 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
|
|||||||
ret = xmlGetDocEntity(ctxt->myDoc, name);
|
ret = xmlGetDocEntity(ctxt->myDoc, name);
|
||||||
if (ret != NULL) {
|
if (ret != NULL) {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"Entity(%s) document marked standalone but require external subset\n",
|
"Entity(%s) document marked standalone but requires external subset\n",
|
||||||
name);
|
name);
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
@ -395,8 +395,9 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
|
|||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
xmlAddChildList((xmlNodePtr) ret, children);
|
xmlAddChildList((xmlNodePtr) ret, children);
|
||||||
} else {
|
} else {
|
||||||
ctxt->sax->error(ctxt,
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
"Failure to process entity %s\n", name);
|
ctxt->sax->error(ctxt->userData,
|
||||||
|
"Failure to process entity %s\n", name);
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
ctxt->validate = 0;
|
ctxt->validate = 0;
|
||||||
@ -460,7 +461,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type,
|
|||||||
systemId, content);
|
systemId, content);
|
||||||
if ((ent == NULL) && (ctxt->pedantic) &&
|
if ((ent == NULL) && (ctxt->pedantic) &&
|
||||||
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"Entity(%s) already defined in the internal subset\n", name);
|
"Entity(%s) already defined in the internal subset\n", name);
|
||||||
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
||||||
xmlChar *URI;
|
xmlChar *URI;
|
||||||
@ -479,7 +480,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type,
|
|||||||
systemId, content);
|
systemId, content);
|
||||||
if ((ent == NULL) && (ctxt->pedantic) &&
|
if ((ent == NULL) && (ctxt->pedantic) &&
|
||||||
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"Entity(%s) already defined in the external subset\n", name);
|
"Entity(%s) already defined in the external subset\n", name);
|
||||||
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
||||||
xmlChar *URI;
|
xmlChar *URI;
|
||||||
@ -495,7 +496,7 @@ xmlSAX2EntityDecl(void *ctx, const xmlChar *name, int type,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"SAX.xmlSAX2EntityDecl(%s) called while not in subset\n", name);
|
"SAX.xmlSAX2EntityDecl(%s) called while not in subset\n", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -538,7 +539,7 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
|
|||||||
(xmlAttributeDefault) def, defaultValue, tree);
|
(xmlAttributeDefault) def, defaultValue, tree);
|
||||||
else {
|
else {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n", name);
|
"SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n", name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -583,7 +584,7 @@ xmlSAX2ElementDecl(void *ctx, const xmlChar * name, int type,
|
|||||||
name, (xmlElementTypeVal) type, content);
|
name, (xmlElementTypeVal) type, content);
|
||||||
else {
|
else {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
|
"SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
|
||||||
name);
|
name);
|
||||||
return;
|
return;
|
||||||
@ -619,7 +620,7 @@ xmlSAX2NotationDecl(void *ctx, const xmlChar *name,
|
|||||||
|
|
||||||
if ((publicId == NULL) && (systemId == NULL)) {
|
if ((publicId == NULL) && (systemId == NULL)) {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n", name);
|
"SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n", name);
|
||||||
ctxt->valid = 0;
|
ctxt->valid = 0;
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
@ -632,7 +633,7 @@ xmlSAX2NotationDecl(void *ctx, const xmlChar *name,
|
|||||||
publicId, systemId);
|
publicId, systemId);
|
||||||
else {
|
else {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"SAX.xmlSAX2NotationDecl(%s) called while not in subset\n", name);
|
"SAX.xmlSAX2NotationDecl(%s) called while not in subset\n", name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -671,7 +672,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name,
|
|||||||
publicId, systemId, notationName);
|
publicId, systemId, notationName);
|
||||||
if ((ent == NULL) && (ctxt->pedantic) &&
|
if ((ent == NULL) && (ctxt->pedantic) &&
|
||||||
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"Entity(%s) already defined in the internal subset\n", name);
|
"Entity(%s) already defined in the internal subset\n", name);
|
||||||
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
||||||
xmlChar *URI;
|
xmlChar *URI;
|
||||||
@ -691,7 +692,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name,
|
|||||||
publicId, systemId, notationName);
|
publicId, systemId, notationName);
|
||||||
if ((ent == NULL) && (ctxt->pedantic) &&
|
if ((ent == NULL) && (ctxt->pedantic) &&
|
||||||
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
(ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"Entity(%s) already defined in the external subset\n", name);
|
"Entity(%s) already defined in the external subset\n", name);
|
||||||
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
if ((ent != NULL) && (ent->URI == NULL) && (systemId != NULL)) {
|
||||||
xmlChar *URI;
|
xmlChar *URI;
|
||||||
@ -707,7 +708,7 @@ xmlSAX2UnparsedEntityDecl(void *ctx, const xmlChar *name,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"SAX.xmlSAX2UnparsedEntityDecl(%s) called while not in subset\n", name);
|
"SAX.xmlSAX2UnparsedEntityDecl(%s) called while not in subset\n", name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -924,7 +925,7 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
if (uri == NULL) {
|
if (uri == NULL) {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt->userData,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"nmlns: %s not a valid URI\n", val);
|
"xmlns: %s not a valid URI\n", val);
|
||||||
} else {
|
} else {
|
||||||
if (uri->scheme == NULL) {
|
if (uri->scheme == NULL) {
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
@ -1028,8 +1029,9 @@ xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
|
|||||||
xmlAttrPtr prop;
|
xmlAttrPtr prop;
|
||||||
namespace = xmlSearchNs(ctxt->myDoc, ctxt->node, ns);
|
namespace = xmlSearchNs(ctxt->myDoc, ctxt->node, ns);
|
||||||
if (namespace == NULL) {
|
if (namespace == NULL) {
|
||||||
ctxt->sax->error(ctxt->userData,
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
"Namespace prefix %s of attribute %s is not defined\n",
|
ctxt->sax->error(ctxt->userData,
|
||||||
|
"Namespace prefix %s of attribute %s is not defined\n",
|
||||||
ns, name);
|
ns, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
xmlIO.c
8
xmlIO.c
@ -2609,10 +2609,10 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID,
|
|||||||
ID = "NULL";
|
ID = "NULL";
|
||||||
if ((ctxt->validate) && (ctxt->sax != NULL) &&
|
if ((ctxt->validate) && (ctxt->sax != NULL) &&
|
||||||
(ctxt->sax->error != NULL))
|
(ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"failed to load external entity \"%s\"\n", ID);
|
"failed to load external entity \"%s\"\n", ID);
|
||||||
else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"failed to load external entity \"%s\"\n", ID);
|
"failed to load external entity \"%s\"\n", ID);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
@ -2620,10 +2620,10 @@ xmlDefaultExternalEntityLoader(const char *URL, const char *ID,
|
|||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
if ((ctxt->validate) && (ctxt->sax != NULL) &&
|
if ((ctxt->validate) && (ctxt->sax != NULL) &&
|
||||||
(ctxt->sax->error != NULL))
|
(ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"failed to load external entity \"%s\"\n", resource);
|
"failed to load external entity \"%s\"\n", resource);
|
||||||
else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
else if ((ctxt->sax != NULL) && (ctxt->sax->warning != NULL))
|
||||||
ctxt->sax->warning(ctxt,
|
ctxt->sax->warning(ctxt->userData,
|
||||||
"failed to load external entity \"%s\"\n", resource);
|
"failed to load external entity \"%s\"\n", resource);
|
||||||
}
|
}
|
||||||
if ((resource != NULL) && (resource != (xmlChar *) URL))
|
if ((resource != NULL) && (resource != (xmlChar *) URL))
|
||||||
|
Reference in New Issue
Block a user