# XML.ignoreWhite

**URL:** <https://forum.kirupa.com/t/xml-ignorewhite/8548>\
**Category:** flash\
**Created:** [November 23, 2002, 12:56pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548 "2002-11-23T12:56:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danneman](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@Danneman](https://forum.kirupa.com/u/Danneman)\
**Post date:** [November 23, 2002, 12:56pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/1 "2002-11-23T12:56:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 2:23pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/2 "2002-11-23T14:23:21Z")

</div>

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:

```php
<?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:

```php

<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

```

* * *

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 5:29pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/3 "2002-11-23T17:29:30Z")

</div>

What form you want the result:q:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 8:24pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/4 "2002-11-23T20:24:11Z")

</div>

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

```auto
 brackets - nothing).

Extra blank lines are outputted in the dynamic textbox.
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 8:36pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/5 "2002-11-23T20:36:04Z")

</div>

PHP Tags would work!

[\*PHP]

```auto
Without the *
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 8:55pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/6 "2002-11-23T20:55:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 23, 2002, 9:04pm UTC](https://forum.kirupa.com/t/xml-ignorewhite/8548/7 "2002-11-23T21:04:22Z")

</div>

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