XML.ignoreWhite

So, another xml-related question for you :

Ive linked a xml-document (just simple text) to a dynamic textfield.

The text displays, alright, but somehow the browser or the parser or whatever chooses to display extra break-lines.

Ive set the dynamic textfield to read html, so it will break when the actionscript outputs a “< br>”, for instance.

Ive read about the XML.ignoreWhite, and drew the conclusion that this might have something to do with the problem. But when I try to put it in my code, the text wont show alltogether.

Very confusing. Tell me if more info is needed for helping out.

Some more info to help the debug:

The actionscript:

XML_var = new XML();

// now load up the url.
XML_var.load(“xml/Studerande.xml”);

// when xml is loaded call functon displayXML
XML_var.onLoad = displayXML;

function displayXML()
{
mainTag = new XML;
elementTag = new XML;
articleList = new Array;
elementList = new Array;
mainTag = this.firstChild.nextSibling;
articleList = mainTag.childNodes;
txt = “”;

//loop through xml
for(i=0;i<=articleList.length;i++)
{//start for
elementList = articleList*.childNodes;
//start for
for(j=0;j<=elementList.length;j++)
{//start for
elementTag = elementList[j];
head = elementTag.firstChild.nodeValue;

//Displays the first
if(elementTag.nodeName.toLowerCase() == “node_head”)
{txt += head +"" “<br>”;}

//Runs through and displays the rest of the nodes in xml-document
else {txt += head +"" + “<br>”;}

}//end for
}//end for
}

Sample XML-file:

<?xml version="1.0" encoding="UTF-8"?>
<xmltest>
<parentnode>
<node_head>Studerande</node_head>
<node1>Anna Pettersson 1</node1>
<node2>Lisa Nilsson</node2>
</parentnode>
</xmltest>


The result displayed:


<first two blank lines - dont want them>
Studerande
<blank line - should only be new line>
Anna Pettersson 1
<blank line - should only be new line>
Lisa Nilsson


What form you want the result:q:

Ok, sorry, I cant get the d**n forum to display the xml-file correct (tried the

 brackets - nothing).

Extra blank lines are outputted in the dynamic textbox.

PHP Tags would work!

[*PHP]

Without the *

Yepp, worked fine :slight_smile: I updated the previous post - hope something can be done about it…

Okay, i would like you to tell me what exactly your trying to achieve:q: