summaryrefslogtreecommitdiff
path: root/xmlwriter.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmlwriter.c')
-rw-r--r--xmlwriter.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xmlwriter.c b/xmlwriter.c
index 2d9d109..69d4b85 100644
--- a/xmlwriter.c
+++ b/xmlwriter.c
@@ -626,9 +626,10 @@ xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version,
* xmlTextWriterEndDocument:
* @writer: the xmlTextWriterPtr
*
- * End an xml document. All open elements are closed
+ * End an xml document. All open elements are closed, and
+ * the content is flushed to the output.
*
- * Returns the bytes written (may be 0 because of buffering) or -1 in case of error
+ * Returns the bytes written or -1 in case of error
*/
int
xmlTextWriterEndDocument(xmlTextWriterPtr writer)
@@ -702,6 +703,9 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer)
return -1;
sum += count;
}
+
+ sum += xmlTextWriterFlush(writer);
+
return sum;
}
@@ -2610,6 +2614,7 @@ xmlTextWriterStartCDATA(xmlTextWriterPtr writer)
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_NONE:
+ case XML_TEXTWRITER_TEXT:
case XML_TEXTWRITER_PI:
case XML_TEXTWRITER_PI_TEXT:
break;