Created
August 20, 2011 11:27
-
-
Save minodisk/1158984 to your computer and use it in GitHub Desktop.
XMLリテラルでCDATA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text:String = 'abc0123456789'; | |
var a:XML = <a><![CDATA[{text}]]></a>; | |
trace(a.toXMLString()); // <a><![CDATA[{text}]]></a>; | |
var b:XML = <b>{'<![CDATA[' + text + ']]>'}</b>; | |
trace(b.toXMLString()); // <b><![CDATA[abc0123456789]]></b> | |
var c:XML = <c>{new XML('<![CDATA[' + text + ']]>')}</c>; | |
trace(c.toXMLString()); // <c><![CDATA[abc0123456789]]></c> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment