3 hours of debug, this was hell:

- SAX.c parser.c xpath.c: generating IDs when not validating
  from an external parsed entity was poisoning the ID has table
  with removed values. This was killing XSLT on the KDE help
  browser.
Daniel
This commit is contained in:
Daniel Veillard 2001-04-18 21:41:07 +00:00
parent ceacdd964d
commit e470df7fdd
4 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,10 @@
Wed Apr 18 23:33:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* SAX.c parser.c xpath.c: generating IDs when not validating
from an external parsed entity was poisoning the ID has table
with removed values. This was killing XSLT on the KDE help
browser.
Wed Apr 18 17:09:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* entities.h: andrew@ugh.net.au detected a double declaration

2
SAX.c
View File

@ -890,7 +890,7 @@ attribute(void *ctx, const xmlChar *fullname, const xmlChar *value)
ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
ctxt->node, ret, value);
}
} else {
} else if (ctxt->external != 2){
/*
* when validating, the ID registration is done at the attribute
* validation level. Otherwise we have to do specific handling here.

View File

@ -4217,13 +4217,16 @@ xmlParseElementChildrenContentDecl
ctxt->entity = ctxt->input;
NEXT;
if (RAW == '?') {
ret->ocur = XML_ELEMENT_CONTENT_OPT;
if (ret != NULL)
ret->ocur = XML_ELEMENT_CONTENT_OPT;
NEXT;
} else if (RAW == '*') {
ret->ocur = XML_ELEMENT_CONTENT_MULT;
if (ret != NULL)
ret->ocur = XML_ELEMENT_CONTENT_MULT;
NEXT;
} else if (RAW == '+') {
ret->ocur = XML_ELEMENT_CONTENT_PLUS;
if (ret != NULL)
ret->ocur = XML_ELEMENT_CONTENT_PLUS;
NEXT;
}
return(ret);
@ -8880,6 +8883,7 @@ xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
xmlParserCtxtPtr ctxt;
xmlDocPtr newDoc;
xmlSAXHandlerPtr oldsax = NULL;
int oldexternal = ctxt->external;
int ret = 0;
if (depth > 40) {
@ -8950,6 +8954,7 @@ xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
*/
ctxt->instate = XML_PARSER_CONTENT;
ctxt->validate = 0;
ctxt->external = 2;
ctxt->loadsubset = 0;
ctxt->depth = depth;

View File

@ -3755,7 +3755,10 @@ xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
*/
xmlNodePtr
xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
if (ctxt->context->node == NULL)
return(NULL);
if (ctxt->context->node->type != XML_ELEMENT_NODE)
return(NULL);
if (cur == NULL) {
if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
return(NULL);