The text of the CDATA section.
Whether a newline followed by an indent will be written to the output range before the cdata section.
Whether an indent will be inserted after each newline within the text.
XMLWritingException if the given text contains "]]>".
import std.array : appender; import std.exception : assertThrown; auto writer = xmlWriter(appender!string()); writer.writeStartTag("root", Newline.no); writer.writeCDATA("see data run"); writer.writeCDATA("More data"); writer.writeCDATA("No preceding newline", Newline.no); writer.writeCDATA("some data\nwith a newline"); writer.writeCDATA("Another newline\nbut no indent", InsertIndent.no); writer.writeStartTag("tag"); writer.writeCDATA(" Deeper data <><> "); writer.writeEndTag("tag"); writer.writeEndTag("root"); assert(writer.output.data == "<root>\n" ~ " <![CDATA[see data run]]>\n" ~ " <![CDATA[More data]]><![CDATA[No preceding newline]]>\n" ~ " <![CDATA[some data\n" ~ " with a newline]]>\n" ~ " <![CDATA[Another newline\n" ~ "but no indent]]>\n" ~ " <tag>\n" ~ " <![CDATA[ Deeper data <><> ]]>\n" ~ " </tag>\n" ~ "</root>"); // ]]> is not legal in a CDATA section. assertThrown!XMLWritingException(writer.writeCDATA("]]>")); // Unchanged after an XMLWritingException is thrown. assert(writer.output.data == "<root>\n" ~ " <![CDATA[see data run]]>\n" ~ " <![CDATA[More data]]><![CDATA[No preceding newline]]>\n" ~ " <![CDATA[some data\n" ~ " with a newline]]>\n" ~ " <![CDATA[Another newline\n" ~ "but no indent]]>\n" ~ " <tag>\n" ~ " <![CDATA[ Deeper data <><> ]]>\n" ~ " </tag>\n" ~ "</root>");
Writes a <![CDATA[...]]> section with the given text between the brackets.