diff --git a/ChangeLog b/ChangeLog index bdc71de6..1380162a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Feb 7 19:22:37 CET 2001 Daniel Veillard + + * valid.c: couple of bug fixes pointed by Gary Pennington + * HTMLtree.c: #if 0 cleanup + Tue Feb 6 14:02:56 CET 2001 Daniel Veillard * xpath.c: started profiling XSLT, added xmlXPathNodeSetAddUnique() diff --git a/HTMLtree.c b/HTMLtree.c index 17fef14e..081ab129 100644 --- a/HTMLtree.c +++ b/HTMLtree.c @@ -888,20 +888,6 @@ htmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, const } xmlOutputBufferWriteString(buf, ">"); if (cur->content != NULL) { -#if 0 - xmlChar *buffer; - -#ifndef XML_USE_BUFFER_CONTENT - buffer = xmlEncodeEntitiesReentrant(doc, cur->content); -#else - buffer = xmlEncodeEntitiesReentrant(doc, - xmlBufferContent(cur->content)); -#endif - if (buffer != NULL) { - xmlOutputBufferWriteString(buf, buffer); - xmlFree(buffer); - } -#else /* * Uses the OutputBuffer property to automatically convert * invalids to charrefs @@ -912,7 +898,6 @@ htmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, const #else xmlOutputBufferWriteString(buf, (const char *) xmlBufferContent(cur->content)); -#endif #endif } if (cur->children != NULL) { diff --git a/valid.c b/valid.c index 8172e716..8fc789e9 100644 --- a/valid.c +++ b/valid.c @@ -2831,12 +2831,14 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc, /* Validity Constraint: ID uniqueness */ if (attrDecl->atype == XML_ATTRIBUTE_ID) { - xmlAddID(ctxt, doc, value, attr); + if (xmlAddID(ctxt, doc, value, attr) == NULL) + ret = 0; } if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) || (attrDecl->atype == XML_ATTRIBUTE_IDREFS)) { - xmlAddRef(ctxt, doc, value, attr); + if (xmlAddRef(ctxt, doc, value, attr) == NULL) + ret = 0; } /* Validity Constraint: Notation Attributes */ @@ -3706,6 +3708,14 @@ xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) { doc->extSubset = oldExt; return(ret); } + if (doc->ids != NULL) { + xmlFreeIDTable(doc->ids); + doc->ids = NULL; + } + if (doc->refs != NULL) { + xmlFreeRefTable(doc->refs); + doc->refs = NULL; + } root = xmlDocGetRootElement(doc); ret = xmlValidateElement(ctxt, doc, root); ret &= xmlValidateDocumentFinal(ctxt, doc); @@ -3825,6 +3835,14 @@ xmlValidateDocument(xmlValidCtxtPtr ctxt, xmlDocPtr doc) { } } + if (doc->ids != NULL) { + xmlFreeIDTable(doc->ids); + doc->ids = NULL; + } + if (doc->refs != NULL) { + xmlFreeRefTable(doc->refs); + doc->refs = NULL; + } ret = xmlValidateDtdFinal(ctxt, doc); if (!xmlValidateRoot(ctxt, doc)) return(0);