# Problem with load xml files

**URL:** <https://forum.kirupa.com/t/problem-with-load-xml-files/203467>\
**Category:** Uncategorized\
**Created:** [October 11, 2006, 10:11am UTC](https://forum.kirupa.com/t/problem-with-load-xml-files/203467 "2006-10-11T10:11:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakri](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@bakri](https://forum.kirupa.com/u/bakri)\
**Post date:** [October 11, 2006, 10:11am UTC](https://forum.kirupa.com/t/problem-with-load-xml-files/203467/1 "2006-10-11T10:11:45Z")

</div>

hi all,  
how u doing??!  
it’s K  
i got this script collect data and search in it from xml file  
the xml file is data.xml:

```auto

<?xml version="1.0" encoding="utf-8" ?>
<data>
 <get>
  <name>david</name>
  <num>123</num>
  <city>London</city>
 </get> 
 <get>
  <name>John</name>
  <num>549</num>
  <city>Kent</city>
 </get> 
</data>

```

and in the javascript file name.js:

```auto

....
.....
var xml_data = 'data.xml';
....
....
if (data_source < 2)
{
 var s = new Array();
 if (window.ActiveXObject)
 {
  var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
  xmldoc.async = false;
  xmldoc.onreadystatechange = function()
  {
   if (xmldoc.readyState == 4) get_xml();
  }
 }
 else if (document.implementation && document.implementation.createDocument)
 {
  var xmldoc = document.implementation.createDocument("", "", null);
  xmldoc.async = false;
  xmldoc.onload = get_xml;
 }
 xmldoc.load(xml_data);
}

```

is this case the script work very good… but …  
But if i want resive data from more than one file  
file 1: data1.xml  
file 2: data2.xml  
file 3: data3.xml  
example:

```auto

var xml_data = new Array()
xml_data[0] = 'data1.xml';
xml_data[0] = 'data2.xml';
xml_data[0] = 'data3.xml';

```

how the javascript script code will be ??!  
i mean what is the code to load more than xml file ?
