1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-02-06 05:57:39 +03:00

- valid.c: couple of bug fixes pointed by Gary Pennington

- HTMLtree.c: #if 0 cleanup
Daniel
This commit is contained in:
Daniel Veillard 2001-02-07 18:24:48 +00:00
parent 2c257ec1ee
commit 5eef6225f7
3 changed files with 25 additions and 17 deletions

View File

@ -1,3 +1,8 @@
Wed Feb 7 19:22:37 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* 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 <Daniel.Veillard@imag.fr>
* xpath.c: started profiling XSLT, added xmlXPathNodeSetAddUnique()

View File

@ -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) {

22
valid.c
View File

@ -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);