all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

ignoreWhite doesn't strip carriage returns?


ignoreWhite doesn't strip carriage returns? ThinkSeed
8/21/2006 11:01:37 PM
flash actionscript:
I have read in many resources that ignoreWhite gets rid of all carriage
returns. Yet, when I run this simple example, I see a visible carriage return
(2 in fact) in the output panel. What is going on here?

XML:
<?xml version="1.0" encoding="UTF-8"?>
<portfolio>
<section sectionName="signature">
<content filename="filename.swf" caption="hello">
This is the text that goes in here.
</content>
</section>
</portfolio>

ActionScript:
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
trace(this);
}
else {
trace("Error loading XML file");
}
};
myXML.load("portfolio.xml");

Here is a screen shot of the output panel:

http://www.thinkseed.com/test/ignoreWhite_output.gif
Re: ignoreWhite doesn't strip carriage returns? abeall
8/22/2006 1:13:58 AM
Re: ignoreWhite doesn't strip carriage returns? ThinkSeed
8/22/2006 7:55:54 PM
I see. Well, I just added a CDATA tag and that helped:

<?xml version="1.0" encoding="UTF-8"?>
<portfolio>
<section sectionName="signature">
<content filename="filename.swf" caption="hello">
<![CDATA[This is the text that goes in here.]]>
</content>
</section>
</portfolio>
AddThis Social Bookmark Button