trying to fix #104934 about some XHTML1 serialization issues. Daniel

* tree.c: trying to fix #104934 about some XHTML1 serialization
  issues.
Daniel
This commit is contained in:
Daniel Veillard 2003-02-10 16:12:39 +00:00
parent 809faa5237
commit fd7ce5f7e1
2 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Mon Feb 10 17:11:22 CET 2003 Daniel Veillard <daniel@veillard.com>
* tree.c: trying to fix #104934 about some XHTML1 serialization
issues.
Mon Feb 10 16:41:13 CET 2003 Daniel Veillard <daniel@veillard.com>
* encoding.c xmlIO.c: fixing bug #104646 about iconv based

21
tree.c
View File

@ -6670,7 +6670,7 @@ xmlNodeDumpOutputInternal(xmlOutputBufferPtr buf, xmlDocPtr doc,
return;
}
if (cur->type == XML_NAMESPACE_DECL) {
xmlNsDumpOutput(buf, cur);
xmlNsDumpOutput(buf, (xmlNsPtr) cur);
return;
}
@ -6980,6 +6980,7 @@ xhtmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
xmlAttrPtr lang = NULL;
xmlAttrPtr name = NULL;
xmlAttrPtr id = NULL;
xmlNodePtr parent;
if (cur == NULL) {
#ifdef DEBUG_TREE
@ -6988,6 +6989,7 @@ xhtmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
#endif
return;
}
parent = cur->parent;
while (cur != NULL) {
if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
id = cur;
@ -7019,9 +7021,20 @@ xhtmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
* C.8
*/
if ((name != NULL) && (id == NULL)) {
xmlOutputBufferWriteString(buf, " id=\"");
xmlAttrSerializeContent(buf->buffer, doc, name);
xmlOutputBufferWriteString(buf, "\"");
if ((parent != NULL) && (parent->name != NULL) &&
((xmlStrEqual(parent->name, BAD_CAST "a")) ||
(xmlStrEqual(parent->name, BAD_CAST "p")) ||
(xmlStrEqual(parent->name, BAD_CAST "div")) ||
(xmlStrEqual(parent->name, BAD_CAST "img")) ||
(xmlStrEqual(parent->name, BAD_CAST "map")) ||
(xmlStrEqual(parent->name, BAD_CAST "applet")) ||
(xmlStrEqual(parent->name, BAD_CAST "form")) ||
(xmlStrEqual(parent->name, BAD_CAST "frame")) ||
(xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
xmlOutputBufferWriteString(buf, " id=\"");
xmlAttrSerializeContent(buf->buffer, doc, name);
xmlOutputBufferWriteString(buf, "\"");
}
}
/*
* C.7.