<< Back to previous view

[DXML-12] Do the right thing if cdata content contains the cdata end-tag "]]>" Created: 21/Nov/12  Updated: 08/Jan/13  Resolved: 08/Jan/13

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

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


 Description   

(xml/emit-str (xml/cdata "fooo]]>bar"))

"<?xml version=\"1.0\" encoding=\"UTF-8\"?><![CDATA[fooo]]>bar]]>"

This is invalid xml. The contract for cdata states that it cannot contain the end tag "]]>", so if the cdata function gets passed content that contains it, it should do the right thing, which is probably this:

http://stackoverflow.com/questions/223652/is-there-a-way-to-escape-a-cdata-end-token-in-xml

(split the content so it is emitted as multiple cdata blocks, none of which contain the entire end-tag "]]>").

This is not a purely academic bug report - I actually hit this problem in prxml and fixed it on my fork.



 Comments   
Comment by Ryan Senior [ 08/Jan/13 10:07 PM ]

Fixed, released in 0.0.7

Generated at Fri Dec 19 02:52:05 CST 2014 using JIRA 4.4#649-r158309.