After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 167166 - GsfXMLOut does not support writing CDATA with multiple calls of gsf_xml_out_add_cstr
GsfXMLOut does not support writing CDATA with multiple calls of gsf_xml_out_a...
Status: RESOLVED FIXED
Product: libgsf
Classification: Core
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2005-02-12 14:36 UTC by Sven Herzberg
Modified: 2005-03-23 03:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that fixes this bug (1.35 KB, patch)
2005-02-12 14:58 UTC, Sven Herzberg
none Details | Review
Test application for the patch (2.02 KB, text/plain)
2005-02-12 15:05 UTC, Sven Herzberg
  Details
Resulting xml file of the test run (327 bytes, text/plain)
2005-02-12 15:07 UTC, Sven Herzberg
  Details
New patch, omits line breaking (1.25 KB, patch)
2005-02-12 18:18 UTC, Sven Herzberg
none Details | Review

Description Sven Herzberg 2005-02-12 14:36:16 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>
Comment 1 Sven Herzberg 2005-02-12 14:58:23 UTC
Created attachment 37400 [details] [review]
Patch that fixes this bug

This patch fixes this bug. Okay to commit?
Comment 2 Sven Herzberg 2005-02-12 15:05:40 UTC
Created attachment 37404 [details]
Test application for the patch

Added a test application
Comment 3 Sven Herzberg 2005-02-12 15:07:25 UTC
Created attachment 37405 [details]
Resulting xml file of the test run
Comment 4 Sven Herzberg 2005-02-12 18:18:36 UTC
Created attachment 37414 [details] [review]
New patch, omits line breaking
Comment 5 Morten Welinder 2005-03-23 03:39:46 UTC
Fixed in cvs.