Boost C++ Libraries: Ticket #8566: Enable writing of CDATA https://svn.boost.org/trac10/ticket/8566 <p> If one tries to write a node using write_xml </p> <p> &lt;example&gt;&lt;![CDATA[&lt;&gt;]]&gt;&lt;/example&gt; </p> <p> the characters &lt;&gt; (and probably &amp; etc.) get escaped in HTML style. The output file will contain </p> <p> &lt;example&gt;&amp;lt;![CDATA[&amp;lt;&amp;gt;]]&amp;gt;&lt;/example&gt; </p> <p> Might it be a solution to introduce another sub-key &lt;xmlcdata&gt; (like &lt;xmlcomment&gt;) and write code analogue to function write_xml_comment like </p> <pre class="wiki"> template&lt;class Ch&gt; void write_xml_xcdata(std::basic_ostream&lt;Ch&gt; &amp;stream, const std::basic_string&lt;Ch&gt; &amp;s, int indent, bool separate_line, const xml_writer_settings&lt;Ch&gt; &amp; settings ) { typedef typename std::basic_string&lt;Ch&gt; Str; if (separate_line) write_xml_indent(stream,indent,settings); stream &lt;&lt; Ch('&lt;') &lt;&lt; Ch('!') &lt;&lt; Ch('[') &lt;&lt; Ch('C') &lt;&lt; Ch('D') &lt;&lt; Ch('A') &lt;&lt; Ch('T') &lt;&lt; Ch('A') &lt;&lt; Ch('['); stream &lt;&lt; s; stream &lt;&lt; Ch(']') &lt;&lt; Ch(']') &lt;&lt; Ch('&gt;'); if (separate_line) stream &lt;&lt; Ch('\n'); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8566 Trac 1.4.3 anonymous Tue, 25 Jul 2017 09:15:58 GMT <link>https://svn.boost.org/trac10/ticket/8566#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8566#comment:1</guid> <description> <p> Ого. 4 года прошло </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 26 Jun 2018 14:27:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8566#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8566#comment:2</guid> <description> <p> Уже 5 )) </p> </description> <category>Ticket</category> </item> </channel> </rss>