[xml] two Patches regarding HTMLtree.c



hi,

maybe someone had those probs too with
dumping trees in memory and corrupting docs
(e.g. Javascripts)

--- HTMLtree.c.orig     Wed Apr  4 14:06:33 2001
+++ HTMLtree.c  Wed Apr  4 14:03:01 2001
@@ -499,6 +499,16 @@
         xmlBufferWriteChar(buf, ";");
        return;
     }
+    if (cur->type == HTML_PRESERVE_NODE) {
+       if (cur->content != NULL) {
+#ifndef XML_USE_BUFFER_CONTENT
+        xmlBufferWriteCHAR(buf, (const char *)cur->content);
+#else
+        xmlBufferWriteCHAR(buf, (const char *) xmlBufferContent(cur->content));
+#endif
+       }
+       return;
+    }
 
     /*
      * Get specific HTmL info for taht node.
@@ -565,17 +575,6 @@
        xmlBufferWriteCHAR(buf, cur->name);
        xmlBufferWriteChar(buf, ">");
     }
-#if 0
-    if (!htmlIsAutoClosed(doc, cur)) {
-       xmlBufferWriteChar(buf, "</");
-       xmlBufferWriteCHAR(buf, cur->name);
-       xmlBufferWriteChar(buf, ">");
-    }
-#else
-    xmlBufferWriteChar(buf, "</");
-    xmlBufferWriteCHAR(buf, cur->name);
-    xmlBufferWriteChar(buf, ">");
-#endif
     if (cur->next != NULL) {
         if ((cur->next->type != HTML_TEXT_NODE) &&
            (cur->next->type != HTML_ENTITY_REF_NODE))
@@ -927,17 +926,9 @@
            (cur->children != cur->last))
            xmlOutputBufferWriteString(buf, "\n");
     }
-#if 0
-    if (!htmlIsAutoClosed(doc, cur)) {
-       xmlOutputBufferWriteString(buf, "</");
-       xmlOutputBufferWriteString(buf, (const char *)cur->name);
-       xmlOutputBufferWriteString(buf, ">");
-    }
-#else
     xmlOutputBufferWriteString(buf, "</");
     xmlOutputBufferWriteString(buf, (const char *)cur->name);
     xmlOutputBufferWriteString(buf, ">");
-#endif
     if (cur->next != NULL) {
         if ((cur->next->type != HTML_TEXT_NODE) &&
            (cur->next->type != HTML_ENTITY_REF_NODE))


Bye
Paul






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]