diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | HTMLtree.c | 22 | ||||
-rw-r--r-- | include/libxml/HTMLtree.h | 5 | ||||
-rw-r--r-- | tree.c | 4 |
4 files changed, 32 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Tue Dec 20 16:55:31 CET 2005 Rob Richards <rrichards@ctindustries.net> + + * tree.c: fix bug #322136 in xmlNodeBufGetContent when entity ref is + a child of an element (fix by Oleksandr Kononenko). + * HTMLtree.c include/libxml/HTMLtree.h: Add htmlDocDumpMemoryFormat. + Tue Dec 20 11:43:06 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.ne> * xmlschemas.c xmlstring.c: Fixed a segfault during @@ -506,16 +506,17 @@ htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) { } /** - * htmlDocDumpMemory: + * htmlDocDumpMemoryFormat: * @cur: the document * @mem: OUT: the memory pointer * @size: OUT: the memory length + * @format: should formatting spaces been added * * Dump an HTML document in memory and return the xmlChar * and it's size. * It's up to the caller to free the memory. */ void -htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { +htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) { xmlOutputBufferPtr buf; xmlCharEncodingHandlerPtr handler = NULL; const char *encoding; @@ -572,7 +573,8 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { return; } - htmlDocContentDumpOutput(buf, cur, NULL); + htmlDocContentDumpFormatOutput(buf, cur, NULL, format); + xmlOutputBufferFlush(buf); if (buf->conv != NULL) { *size = buf->conv->use; @@ -584,6 +586,20 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { (void)xmlOutputBufferClose(buf); } +/** + * htmlDocDumpMemory: + * @cur: the document + * @mem: OUT: the memory pointer + * @size: OUT: the memory length + * + * Dump an HTML document in memory and return the xmlChar * and it's size. + * It's up to the caller to free the memory. + */ +void +htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) { + htmlDocDumpMemoryFormat(cur, mem, size, 1); +} + /************************************************************************ * * diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h index 50b85442..6ea82078 100644 --- a/include/libxml/HTMLtree.h +++ b/include/libxml/HTMLtree.h @@ -75,6 +75,11 @@ XMLPUBFUN void XMLCALL htmlDocDumpMemory (xmlDocPtr cur, xmlChar **mem, int *size); +XMLPUBFUN void XMLCALL + htmlDocDumpMemoryFormat (xmlDocPtr cur, + xmlChar **mem, + int *size, + int format); XMLPUBFUN int XMLCALL htmlDocDump (FILE *f, xmlDocPtr cur); @@ -4906,8 +4906,8 @@ xmlNodeBufGetContent(xmlBufferPtr buffer, xmlNodePtr cur) xmlBufferCat(buffer, tmp->content); break; case XML_ENTITY_REF_NODE: - xmlNodeBufGetContent(buffer, tmp->children); - break; + xmlNodeBufGetContent(buffer, tmp); + break; default: break; } |