# Loading several xml files

**URL:** <https://forum.kirupa.com/t/loading-several-xml-files/263213>\
**Category:** Uncategorized\
**Created:** [June 13, 2008, 12:01pm UTC](https://forum.kirupa.com/t/loading-several-xml-files/263213 "2008-06-13T12:01:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iMike91](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iMike91](https://forum.kirupa.com/u/iMike91)\
**Post date:** [June 13, 2008, 12:01pm UTC](https://forum.kirupa.com/t/loading-several-xml-files/263213/1 "2008-06-13T12:01:43Z")

</div>

I would like to know how to load for example two xml files, and how to address each of the files?  
The red comments will explain what I want

function loadXML(loaded) {  
if (loaded) {  
[COLOR=“Red”]Taking information from file “student.xml” --\>[/COLOR]  
\_root.names = this.firstChild.childNodes[1].childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.grade = this.firstChild.childNodes[1].childNodes[1].childNodes[0].firstChild.nodeValue;  
name\_txt.text = \_root.names;  
class\_txt.text = \_root.grade;  
[COLOR=“red”]Taking information from file “Images.xml”–\>[/COLOR]  
\_root.picture = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;  
pic\_place.loadMovie(\_root.picture);

} else {  
trace(“file not loaded!”);  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“student.xml”,“images.xml”); [COLOR=“red”]\<–loads two files[/COLOR]

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 13, 2008, 1:03pm UTC](https://forum.kirupa.com/t/loading-several-xml-files/263213/2 "2008-06-13T13:03:44Z")

</div>

you will have to have two different load statements with two different commands.

xmlNode1.childnodes[]

xmlNode2.childnodes[]
