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.
// 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>”;}
<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