Index: HTMLtree.c =================================================================== RCS file: /cvs/gnome/libxml2/HTMLtree.c,v retrieving revision 1.99 diff -c -r1.99 HTMLtree.c *** HTMLtree.c 8 Aug 2005 13:46:45 -0000 1.99 --- HTMLtree.c 3 Sep 2005 14:35:00 -0000 *************** *** 748,753 **** --- 748,754 ---- htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, const char *encoding, int format) { const htmlElemDesc * info; + int addmeta = 0; xmlInitParser(); *************** *** 848,860 **** } return; } if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) && (cur->children == NULL)) { ! if ((info != NULL) && (info->saveEndTag != 0) && (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) && (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) { xmlOutputBufferWriteString(buf, ">"); } else { xmlOutputBufferWriteString(buf, ">ns != NULL) && (cur->ns->prefix != NULL)) { xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); --- 849,900 ---- } return; } + + if ((cur->type == XML_ELEMENT_NODE) && + (cur->parent != NULL) && + (cur->parent->parent == (xmlNodePtr) cur->doc) && + xmlStrEqual(BAD_CAST info->name, BAD_CAST "head") && + xmlStrEqual(cur->parent->name, BAD_CAST"html")) { + + xmlNodePtr tmp = cur->children; + while (tmp != NULL) { + if (xmlStrEqual(tmp->name, BAD_CAST"meta")) { + xmlChar *httpequiv; + + httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv"); + if (httpequiv != NULL) { + if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) { + xmlFree(httpequiv); + break; + } + xmlFree(httpequiv); + } + } + tmp = tmp->next; + } + if (tmp == NULL) + addmeta = 1; + } + if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) && (cur->children == NULL)) { ! if ((info != NULL) && (info->saveEndTag != 0) && (addmeta == 0) && (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) && (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) { xmlOutputBufferWriteString(buf, ">"); } else { + if (addmeta == 1) { + xmlOutputBufferWrite(buf, 1, ">"); + xmlOutputBufferWriteString(buf, + "ns != NULL) && (cur->ns->prefix != NULL)) { xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); *************** *** 875,880 **** --- 915,935 ---- return; } xmlOutputBufferWriteString(buf, ">"); + if (addmeta == 1) { + if ((cur->children != NULL) && (format) && + (info != NULL) && (!info->isinline) && + (cur->children->type != HTML_TEXT_NODE) && + (cur->children->type != HTML_ENTITY_REF_NODE)) + xmlOutputBufferWriteString(buf, "\n"); + xmlOutputBufferWriteString(buf, + ""); + } if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) { /* *************** *** 888,894 **** if ((format) && (info != NULL) && (!info->isinline) && (cur->children->type != HTML_TEXT_NODE) && (cur->children->type != HTML_ENTITY_REF_NODE) && ! (cur->children != cur->last) && (cur->name != NULL) && (cur->name[0] != 'p')) /* p, pre, param */ xmlOutputBufferWriteString(buf, "\n"); --- 943,949 ---- if ((format) && (info != NULL) && (!info->isinline) && (cur->children->type != HTML_TEXT_NODE) && (cur->children->type != HTML_ENTITY_REF_NODE) && ! ((cur->children != cur->last) || (addmeta == 1)) && (cur->name != NULL) && (cur->name[0] != 'p')) /* p, pre, param */ xmlOutputBufferWriteString(buf, "\n"); *************** *** 896,902 **** if ((format) && (info != NULL) && (!info->isinline) && (cur->last->type != HTML_TEXT_NODE) && (cur->last->type != HTML_ENTITY_REF_NODE) && ! (cur->children != cur->last) && (cur->name != NULL) && (cur->name[0] != 'p')) /* p, pre, param */ xmlOutputBufferWriteString(buf, "\n"); --- 951,957 ---- if ((format) && (info != NULL) && (!info->isinline) && (cur->last->type != HTML_TEXT_NODE) && (cur->last->type != HTML_ENTITY_REF_NODE) && ! ((cur->children != cur->last) || (addmeta == 1)) && (cur->name != NULL) && (cur->name[0] != 'p')) /* p, pre, param */ xmlOutputBufferWriteString(buf, "\n"); *************** *** 1148,1157 **** handler = xmlFindCharEncodingHandler(encoding); if (handler == NULL) return(-1); - htmlSetMetaEncoding(cur, (const xmlChar *) encoding); } - } else { - htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8"); } /* --- 1203,1209 ---- Index: xmlsave.c =================================================================== RCS file: /cvs/gnome/libxml2/xmlsave.c,v retrieving revision 1.27 diff -c -r1.27 xmlsave.c *** xmlsave.c 3 Sep 2005 14:56:36 -0000 1.27 --- xmlsave.c 3 Sep 2005 17:58:24 -0000 *************** *** 1240,1245 **** --- 1240,1252 ---- } else { if (addmeta == 1) { xmlOutputBufferWrite(buf, 1, ">"); + if (ctxt->format) { + xmlOutputBufferWrite(buf, 1, "\n"); + if (xmlIndentTreeOutput) + xmlOutputBufferWrite(buf, ctxt->indent_size * + (ctxt->level + 1 > ctxt->indent_nr ? + ctxt->indent_nr : ctxt->level + 1), ctxt->indent); + } xmlOutputBufferWriteString(buf, "ns != NULL) && (cur->ns->prefix != NULL)) { xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); xmlOutputBufferWrite(buf, 1, ":"); --- 1254,1269 ---- } else { xmlOutputBufferWrite(buf, 5, "UTF-8"); } ! xmlOutputBufferWrite(buf, 4, "\" />"); ! if (ctxt->format) ! xmlOutputBufferWrite(buf, 1, "\n"); ! } else { ! xmlOutputBufferWrite(buf, 1, ">"); } /* * C.3. Element Minimization and Empty Element Content */ ! xmlOutputBufferWrite(buf, 2, "ns != NULL) && (cur->ns->prefix != NULL)) { xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix); xmlOutputBufferWrite(buf, 1, ":"); *************** *** 1264,1269 **** --- 1275,1287 ---- } xmlOutputBufferWrite(buf, 1, ">"); if (addmeta == 1) { + if (ctxt->format) { + xmlOutputBufferWrite(buf, 1, "\n"); + if (xmlIndentTreeOutput) + xmlOutputBufferWrite(buf, ctxt->indent_size * + (ctxt->level + 1 > ctxt->indent_nr ? + ctxt->indent_nr : ctxt->level + 1), ctxt->indent); + } xmlOutputBufferWriteString(buf, " ! This service is temporary down

Sorry, this service is temporary down

We are doing our best to get it back on-line, --- 1,9 ---- ! ! ! This service is temporary down !

Sorry, this service is temporary down

We are doing our best to get it back on-line, Index: result/HTML/cf_128.html =================================================================== RCS file: /cvs/gnome/libxml2/result/HTML/cf_128.html,v retrieving revision 1.4 diff -c -r1.4 cf_128.html *** result/HTML/cf_128.html 1 Sep 2005 09:52:30 -0000 1.4 --- result/HTML/cf_128.html 3 Sep 2005 13:50:17 -0000 *************** *** 1,6 **** ! gnome-xml push mode bug --- 1,9 ---- ! ! ! gnome-xml push mode bug !
Index: result/HTML/liclose.html =================================================================== RCS file: /cvs/gnome/libxml2/result/HTML/liclose.html,v retrieving revision 1.4 diff -c -r1.4 liclose.html *** result/HTML/liclose.html 1 Sep 2005 09:52:30 -0000 1.4 --- result/HTML/liclose.html 3 Sep 2005 14:15:30 -0000 *************** *** 1,6 **** !