diff --git a/ChangeLog b/ChangeLog index 9f1a5e0f..839965fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Apr 18 23:33:11 CEST 2001 Daniel Veillard + + * 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 * entities.h: andrew@ugh.net.au detected a double declaration diff --git a/SAX.c b/SAX.c index 9691a888..c3f94fc0 100644 --- a/SAX.c +++ b/SAX.c @@ -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. diff --git a/parser.c b/parser.c index 8483069e..a784f716 100644 --- a/parser.c +++ b/parser.c @@ -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; diff --git a/xpath.c b/xpath.c index 48ddc75b..7d4fc328 100644 --- a/xpath.c +++ b/xpath.c @@ -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);