mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
fix bug #322136 in xmlNodeBufGetContent when entity ref is a child of an
* 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.
This commit is contained in:
parent
5bb0c08d2f
commit
77b92ff6a8
@ -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
|
||||
|
22
HTMLtree.c
22
HTMLtree.c
@ -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);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user