# XML Loop: displaying MULTIPLE events

**URL:** https://forum.kirupa.com/t/xml-loop-displaying-multiple-events/166634
**Category:** flash
**Created:** [October 21, 2005, 2:02pm UTC](https://forum.kirupa.com/t/xml-loop-displaying-multiple-events/166634 "2005-10-21T14:02:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@marius](https://forum.kirupa.com/u/marius)
#### Post date: [October 21, 2005, 2:02pm UTC](https://forum.kirupa.com/t/xml-loop-displaying-multiple-events/166634/1 "2005-10-21T14:02:49Z")

</div>

I have the following XML. Currently it is only pulling one event item from xml data source. I would like to add the ability to pull multiple events listed on the same day.

**XML structure:**

\<year value=“2005”\>  
\<month value=“10”\>  
\<day value=“20”\>  
\<label\>Test\</label\>  
\<description\>\</description\>  
\</day\>  
\<day value=“20”\>  
\<label\>Test\</label\>  
\<description\>details…\</description\>  
\</day\>  
\</month\>  
\</year\>  
\</calendar\>

**Code that I am modifying:**

\_root.dayNode\_xml=monthNode\_xml.firstChild;  
\_root.dayNode\_xml=setDay(\_root.dayNode\_xml,1,“square1”);

**Researching I found this code and I’m pretty sure formatted correctly this is the answer to my issues:**

if (topLevel != null)  
{  
for (i = 0; i \<= topLevel.childNodes.length; i++)  
{  
if (topLevel.childNodes\*.nodeName == “mp3file”)  
{  
var track = topLevel.childNodes\*.attributes[“track”];
