GNOME Bugzilla – Bug 167166
GsfXMLOut does not support writing CDATA with multiple calls of gsf_xml_out_add_cstr
Last modified: 2005-03-23 03:39:46 UTC
I'd like to write an XML file within several small steps: gint main(gint argc, gchar** argv) { GsfXMLOut* xmlout; GsfOutput* out; gsf_init(); out = gsf_output_stdio_new("demo.xml", NULL); xmlout = gsf_xml_out_new(out); gsf_xml_out_start_element(xmlout, "output"); gsf_xml_out_add_cstr(xmlout, NULL, "Text 1"); gsf_xml_out_add_cstr(xmlout, NULL, "Text 2"); gsf_xml_out_end_element(xmlout); gsf_output_close(out); return 0; } This results in an xml file like this: <?xml version="1.0" encoding="UTF-8"?> <output>Text 1>Text 2</output> The expected output would be something like: <?xml version="1.0" encoding="UTF-8"?> <output>Text 1 Text 2</output>
Created attachment 37400 [details] [review] Patch that fixes this bug This patch fixes this bug. Okay to commit?
Created attachment 37404 [details] Test application for the patch Added a test application
Created attachment 37405 [details] Resulting xml file of the test run
Created attachment 37414 [details] [review] New patch, omits line breaking
Fixed in cvs.