# XML whitespace problem

**URL:** <https://forum.kirupa.com/t/xml-whitespace-problem/299168>\
**Category:** flash\
**Created:** [October 30, 2009, 11:18pm UTC](https://forum.kirupa.com/t/xml-whitespace-problem/299168 "2009-10-30T23:18:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![surf](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@surf](https://forum.kirupa.com/u/surf)\
**Post date:** [October 30, 2009, 11:18pm UTC](https://forum.kirupa.com/t/xml-whitespace-problem/299168/1 "2009-10-30T23:18:17Z")

</div>

Hi i have the following code that works perfectly fine

```auto

var loader:URLLoader;
var job:Object;
var obArray:Array;
loadXML();
function loadXML():void {
    
    try {
        loader=new URLLoader(new URLRequest("http://smthakur.com/php/xml/blog.xml"));
        loader.addEventListener(ProgressEvent.PROGRESS, progress);
        loader.addEventListener(Event.COMPLETE, complete);
    } catch (Er:Error) {
        trace("xml Eror" + Er.message);
    }
}

function progress(e : ProgressEvent):void {
}

function complete(e : Event):void {
    var xml:XML=new XML(e.target.data);
    XML.ignoreWhitespace=true;
    

    obArray = new Array();
    var list:XMLList=xml.ob;
    for (var i : int = 0; i < list.length(); i++) {
        job = new Object();
        job.title=list*.title;
        job.content=list*.content;
        obArray.push(job);
    }
//i know how to use the for loop .. im just using 0 for demonstration
txtfield.htmlText = obArray[0].title + "
" + obArray[0].content;  

}

```

when the contents are loaded into the txtfield… there are loads of spaces between images and the contents… how can i remove the whitespaces when i have already declared it?
