Commit 7cd517c2 authored by Daniel Veillard's avatar Daniel Veillard

applied patch from Mark Vakoc fixing saving of CDATA with NULL content.

* xmlsave.c: applied patch from Mark Vakoc fixing saving of
  CDATA with NULL content.
Daniel
parent 690a6809
Fri May 20 20:48:08 CEST 2005 Daniel Veillard <daniel@veillard.com>
* xmlsave.c: applied patch from Mark Vakoc fixing saving of
CDATA with NULL content.
Thu May 12 15:14:26 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemastypes.c: Changed the VALID_TZO macro to restrict
......
......@@ -715,21 +715,26 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
return;
}
if (cur->type == XML_CDATA_SECTION_NODE) {
start = end = cur->content;
while (*end != '\0') {
if ((*end == ']') && (*(end + 1) == ']') && (*(end + 2) == '>')) {
end = end + 2;
if (cur->content == NULL) {
xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
} else {
start = end = cur->content;
while (*end != '\0') {
if ((*end == ']') && (*(end + 1) == ']') &&
(*(end + 2) == '>')) {
end = end + 2;
xmlOutputBufferWrite(buf, 9, "<![CDATA[");
xmlOutputBufferWrite(buf, end - start, (const char *)start);
xmlOutputBufferWrite(buf, 3, "]]>");
start = end;
}
end++;
}
if (start != end) {
xmlOutputBufferWrite(buf, 9, "<![CDATA[");
xmlOutputBufferWrite(buf, end - start, (const char *)start);
xmlOutputBufferWriteString(buf, (const char *)start);
xmlOutputBufferWrite(buf, 3, "]]>");
start = end;
}
end++;
}
if (start != end) {
xmlOutputBufferWrite(buf, 9, "<![CDATA[");
xmlOutputBufferWriteString(buf, (const char *)start);
xmlOutputBufferWrite(buf, 3, "]]>");
}
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment