GNOME Bugzilla – Bug 725433
Simple XML Subset Parser doesn't strip out CDATA sections completely
Last modified: 2015-09-05 16:58:36 UTC
Created attachment 270619 [details] XML test file Using the Simple XML parser, when creating a new context with the G_MARKUP_TREAT_CDATA_AS_TEXT flag, the resulting text handler is passed in the following incorrect text: This is CDATA]]> (The problem is the ]]> is not stripped out) Attached is the XML document that sees the behavior. Code: int flags = G_MARKUP_TREAT_CDATA_AS_TEXT; context = g_markup_parse_context_new(&_full_parser, flags, NULL, NULL); ... If a more detailed coding example is necessary let me know. ====== System Info ======= lsb_release -a ---------------- No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.2 LTS Release: 12.04 Codename: precise uname -a -------- Linux testbox 3.2.0-33-generic #52-Ubuntu SMP Thu Oct 18 16:29:15 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
I'm not seeing that here, in git master. I've added your example as a testcase to our testsuite, and it produces the expected output.
Hmm? Does the original code section look correct? I just upgraded libglib2.0-dev which upgraded it to 2.32.4. Again I ran it with that flag and got the incorrect result where the end CDATA tag is incorrect. -------------- $ sudo apt-get install libglib2.0-dev Setting up libglib2.0-0 (2.32.4-0ubuntu1) ... Setting up libglib2.0-bin (2.32.4-0ubuntu1) ... Setting up libglib2.0-dev (2.32.4-0ubuntu1) ... -------------- Could you provide the code of how the test is running it against the file I provided. Perhaps I'm not calling it correctly.
See commit 79caa3a7e151897b062f82251eec207bc1514ff3 Author: Matthias Clasen <mclasen@redhat.com> Date: Sun Mar 2 19:10:00 2014 -0500 Add a few tests for G_MARKUP_TREAT_CDATA_AS_TEXT Related to https://bugzilla.gnome.org/show_bug.cgi?id=725433