Groups | Blog | Home
all groups > flash actionscript > january 2006 >

flash actionscript : XML ignoreWhite doesn't work



bsidemedia
1/25/2006 10:07:46 PM
Using sendAndLoad() to retrieve xml from a server, the response is stored in a
new XML object. stripWhite=true DOES NOT eliminate whitespace between nodes.

Using sendAndLoad() to retrieve xml from a local doc.xml, stripWhite=true DOES
eliminate whitespace between nodes.

Unfortunately I need to load xml from a server. How can I strip the whitespace
from xml that is loaded from the server?
David Powers
1/25/2006 11:07:58 PM
[quoted text, click to view]

Not surprising really. The correct property is ignoreWhite, not
stripWhite. Your subject line is correct, but not the code in your post.

ignoreWhite = true;

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
bsidemedia
1/26/2006 1:11:22 AM
sry about that. The code I am using is correct. I quoted it wrong (not
surprising). But does this make my post anymore suprising? I have come accross
some user groups that have experienced this same issue and appear to simply
accept it as a fact of life.
bsidemedia
1/28/2006 9:43:17 PM
kaunietiz
1/29/2006 12:00:00 AM
_Flep_
1/29/2006 3:07:09 PM
kokochka
2/8/2006 12:00:00 AM
I had the same problem with ignoreWhite.

The problem was :
When it's loaded with ignoreWhite = false, it was loaded correctly with

myXML = new XML();
myXML.ignoreWhite = false;
myXML.onLoad = function(success) {
if(success) {
myXML.onLoad
rootElement = this.firstChild.nextSibling;
trace(rootElement);
}
}


***************
In order that this works with
myXML.ignoreWhite = true;

rootElement should be declared as
rootElement = this.firstChild;
and not rootElement = this.firstChild.nextSibling;

Hope this helps

AddThis Social Bookmark Button