# Combining arrays into a textfield

**URL:** https://forum.kirupa.com/t/combining-arrays-into-a-textfield/166615
**Category:** Uncategorized
**Created:** [October 21, 2005, 10:01am UTC](https://forum.kirupa.com/t/combining-arrays-into-a-textfield/166615 "2005-10-21T10:01:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Project004](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@Project004](https://forum.kirupa.com/u/Project004)
#### Post date: [October 21, 2005, 10:01am UTC](https://forum.kirupa.com/t/combining-arrays-into-a-textfield/166615/1 "2005-10-21T10:01:14Z")

</div>

Hi,

I’ve successfully loaded my xml and created three arrays to hold the news article date, title and text, using the following code:

```auto
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
	if (success) {
		publishNews(my_xml);
	}
};
function publishNews(xml_doc) {
	var newsdate = new Array();
	var newstitle = new Array();
	var newstext = new Array();
	for (var n = 0; n<xml_doc.firstChild.childNodes.length; n++) {
		newstext.push(xml_doc.firstChild.childNodes[n].firstChild.firstChild);
newstitle.push(xml_doc.firstChild.childNodes[n].firstChild.nextSibling.firstChild); 			
        newsdate.push(xml_doc.firstChild.childNodes[n].firstChild.nextSibling.nextSibling.firstChild);
	}
}
my_xml.load(&quot;http://url....GetNewsData&quot;);
stop();

```

Here is my xml:

\<NewDataSet\>  
\<Table\>  
\<pg\_data\>Lorem ipsum dolor sit amet\</pg\_data\>  
\<pg\_title\>test title 1\</pg\_title\>  
\<pg\_timestamp\>2005-10-20T00:00:00.0000000+01:00\</pg\_timestamp\>  
\</Table\>

```
&lt;Table&gt;
    &lt;pg_data&gt;this is another news article&lt;/pg_data&gt;
    &lt;pg_title&gt;test title 2&lt;/pg_title&gt;
    &lt;pg_timestamp&gt;2005-10-21T00:00:00.0000000+01:00&lt;/pg_timestamp&gt;
&lt;/Table&gt;

```

\</NewDataSet\>

How do I firstly get my arrays into a textfield with the format date,\<br\> title,\<br\> story, and secondly how do I deal with that horrible datestamp to make a recognisable uk date?

Thanks in advance

P.
