- added the patch from Carl Nygard <cnygard@bellatlantic.net>
which allow impressive speed improvement on dataset with large text
pieces, but at the cost of broken binary compatibility and slightly
bigger memory usage. Configure with --with-buffers to activate them,
they are protected with XML_USE_BUFFER_CONTENT define.
- added xmlCleanupPredefinedEntities(), memory allocation cleanup
Daniel
diff --git a/HTMLtree.c b/HTMLtree.c
index 53d9389..a114e65 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -152,7 +152,12 @@
xmlChar *buffer;
/* uses the HTML encoding routine !!!!!!!!!! */
+#ifndef XML_USE_BUFFER_CONTENT
buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+#else
+ buffer = xmlEncodeEntitiesReentrant(doc,
+ xmlBufferContent(cur->content));
+#endif
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
xmlFree(buffer);
@@ -163,7 +168,11 @@
if (cur->type == HTML_COMMENT_NODE) {
if (cur->content != NULL) {
xmlBufferWriteChar(buf, "<!--");
+#ifndef XML_USE_BUFFER_CONTENT
xmlBufferWriteCHAR(buf, cur->content);
+#else
+ xmlBufferWriteCHAR(buf, xmlBufferContent(cur->content));
+#endif
xmlBufferWriteChar(buf, "-->");
}
return;
@@ -213,7 +222,12 @@
if (cur->content != NULL) {
xmlChar *buffer;
- buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+#ifndef XML_USE_BUFFER_CONTENT
+ buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+#else
+ buffer = xmlEncodeEntitiesReentrant(doc,
+ xmlBufferContent(cur->content));
+#endif
if (buffer != NULL) {
xmlBufferWriteCHAR(buf, buffer);
xmlFree(buffer);