<< Back to previous view

[DXML-17] Embedded CDATA end tags are not properly handled Created: 19/Jun/13  Updated: 14/Aug/13  Resolved: 14/Aug/13

Status: Resolved
Project: data.xml
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Jeff Weiss Assignee: Ryan Senior
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File dxml17.patch    


user> (xml/indent-str (xml/sexp-as-element [:pre [:-cdata "foo]]>bar"]]))
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><pre><![CDATA[foo]]><![CDATA[bar]]></pre>\n"

What's being emitted here is cdata for foobar not foo]]>bar.

What needs to be done is break up the embedded ]]> so that the first two characters are in one cdata block, and the last character is in the next block.

The tests are wrong, as far as I can tell. I think I have fixed the code and the tests, I just need to figure out how to run the tests and submit a patch.

Comment by Jeff Weiss [ 20/Jun/13 8:16 AM ]

Patch that fixes issue and tests

Comment by Jeff Weiss [ 20/Jun/13 8:18 AM ]

And just to clear up what the issue is, currently if the cdata contains the cdata end tag "]]>" it is just dropped and when the xml is read in those characters are gone.

That is not correct behavior, the cdata should be able to contain any arbitrary characters without any loss of data, and the attached patch will allow this.

Comment by Ryan Senior [ 14/Aug/13 11:52 PM ]

Thanks for the patch! It's been pushed up and will be in the next release.

Generated at Thu Jan 18 16:13:39 CST 2018 using JIRA 4.4#649-r158309.