You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CDATA element do not use character entities, but also need the "]]" terminator added at the end.
But I still don't understand the reason for the "]]" terminator.
I have do a test:
1、new a CDATA node by 'mxmlNewCDATA', the data is "test for cdata"
2、read the node by 'mxmlGetCDATA' immediately
3、save the whole tree to a xml file
The result is:
->2、the string read out is more than a ']]', it is "test for cdata]]"
->3、in the xml file, the CDATA has a redundant "]]", it is
mxmlNewCDATA adds the "<![CDATA[...]]" wrapper around the string for you. When you call mxmlGetCDATA the returned string includes the trailing "]]" (since it was added for you).
I will add a note about this to the documentation, but short of making a copy of the string there isn't any way around this in Mini-XML 2.x. In 3.x I plan on making CDATA nodes have their own type so we can just store the raw string.
In the source code(mxml-file.c), It says
But I still don't understand the reason for the "]]" terminator.
I have do a test:
1、new a CDATA node by 'mxmlNewCDATA', the data is "test for cdata"
2、read the node by 'mxmlGetCDATA' immediately
3、save the whole tree to a xml file
The result is:
->2、the string read out is more than a ']]', it is "test for cdata]]"
->3、in the xml file, the CDATA has a redundant "]]", it is
<![CDATA[test for cdata]]]]>
But as I known, it should be
<![CDATA[test for cdata]]>
Is this a bug or for other purpose ? @michaelrsweet
The text was updated successfully, but these errors were encountered: