# Read from xml

**URL:** <https://forum.kirupa.com/t/read-from-xml/283271>\
**Category:** Uncategorized\
**Created:** [March 4, 2009, 11:51am UTC](https://forum.kirupa.com/t/read-from-xml/283271 "2009-03-04T11:51:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel\_mihalcea](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@daniel\_mihalcea](https://forum.kirupa.com/u/daniel_mihalcea)\
**Post date:** [March 4, 2009, 11:51am UTC](https://forum.kirupa.com/t/read-from-xml/283271/1 "2009-03-04T11:51:43Z")

</div>

I have an xml file like this:  
\<root\>  
\<main name=“first”\>  
\<image name = “” path = “” &gt;  
\<image name = “” path = “” &gt;  
… will be 12 images  
\</main\>  
\<main name=“second”\>  
\<image name = “” path = “” &gt;  
\<image name = “” path = “” &gt;  
… will be 12 images  
\</main\>  
… will be 5 main  
\</root\>

So I will have 5 sets of 12 images.  
I have to do a project which will load each set separated from the other. Because it could be a time when a set is empty and I want to skip it.  
Basically I want to read a set on a click.  
Something like this: I have a button, I press it and I load \<main name=“second”\> set, if main name =“second” is empty the others are empty to.  
I don’t start with \<main name=“first”\> when I click, because this one is full and I have to load it first on stage.  
So I have to read the first set, show it, and then after I press the button to read the second set etc.  
Any suggestions?  
Thank you.
