# Reading XML

**URL:** <https://forum.kirupa.com/t/reading-xml/159446>\
**Category:** Uncategorized\
**Created:** [August 17, 2005, 3:54pm UTC](https://forum.kirupa.com/t/reading-xml/159446 "2005-08-17T15:54:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stunt\_penguin](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@stunt\_penguin](https://forum.kirupa.com/u/stunt_penguin)\
**Post date:** [August 17, 2005, 3:54pm UTC](https://forum.kirupa.com/t/reading-xml/159446/1 "2005-08-17T15:54:52Z")

</div>

I’m working on a simple image gallery that will use an xml document to load in varibales.

I read in this xml document sructure from my text file:

```auto

<?xml version="1.0" encoding="iso-8859-1"?>
 
 <gallery>
 
   <image>
 	  <thumb>thumb_1.jpg</thumb>
 	  <imageName>image_1.jpg</image>
 	  <caption>Image 1 caption</caption> 
   </ image>
 
   <image>
 	  <thumb>thumb_2.jpg</thumb>
 	  <imageName>image_2.jpg</image>
 	  <caption>Image 2 caption</caption> 
   </ image>
 
 <gallery>

```

using the following actionscript:

```auto

var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.load("events/events.xml");

gallery_xml.onLoad = function(success) {
	if (success) {
		trace(gallery_xml.childNodes)

	}
};

```

when i look at the trace of gallery\_xml.childNodes, I get this:

> \<gallery\>\<image\>\<thumb\>thumb\_1.jpg\</thumb\>\<imageName\>image\_1.jpg\</imageName\>\</image\>\</gallery\>

My XML appears to have loaded in incorrectly- the xml object is only quoting back the first \<image\> tag, not its siblings. When i try to access the second \<image\> node my structure, it isn’t there at all.

Its probably something simple- can anyone help?
