# XML from xml..?

**URL:** <https://forum.kirupa.com/t/xml-from-xml/185506>\
**Category:** flash\
**Created:** [April 13, 2006, 7:48pm UTC](https://forum.kirupa.com/t/xml-from-xml/185506 "2006-04-13T19:48:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brisa](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Brisa](https://forum.kirupa.com/u/Brisa)\
**Post date:** [April 13, 2006, 7:48pm UTC](https://forum.kirupa.com/t/xml-from-xml/185506/1 "2006-04-13T19:48:01Z")

</div>

I have two Lists (components) on stage. The first one (mainList populates from an XML called topics.xml

```auto
<?xml version="1.0" encoding="ISO-8859-1"?>
<topics>
<topic url="topic1.xml" desc="Topic 1" />
<topic url="topic2.xml" desc="Topic 2" />
<topic url="topic3.xml" desc="Topic 3" />
<topic url="topic4.xml" desc="Topic 4" />
<topic url="topic5.xml" desc="Topic 5" />
</topics>

```

on event handler change, I want to load the second list on the other list component, called subList…It’s not loading…:\*(

I believe it’s because when it reads the data from my topics list, it reads topic1.xml instead of “topic1.xml” ( reads without the quotes).

If I unquote line v.list.load(“subtopic.xml”), it works, but I need it to be loaded from the XML…

```auto
import mx.controls.Menu;

var vlist:XML = new XML();
vlist.ignoreWhite = true;

vlist.onLoad = function() {
    var subTopics:Array = this.firstChild.childNodes;
    for(i=0;i<subTopics.length;i++) {
        subList.addItem(subTopics*.attributes.desc,subTopics*.attributes.url);
    }
    
    Loader.load(subList.getItemAt(0).data);
    subList.selectedIndex = 0;
}
    
var vidList:Object = new Object();

vidList.change = function() {
    videoLoader.load(subList.getItemAt(subList.selectedIndex).data);
}

subList.addEventListener("change",vidList);

//vlist.load("subtopic.xml");

var mlist:XML = new XML();
mlist.ignoreWhite = true;

mlist.onLoad = function() {
    var topics:Array = this.firstChild.childNodes;
    for(i=0;i<topics.length;i++) {
        mainList.addItem(topics*.attributes.desc,topics*.attributes.url);
    }
}
    
var cmList:Object = new Object();

cmList.change = function() {
    vList.load(mainList.getItemAt(mainList.selectedIndex).data);
    trace(mainList.getItemAt(mainList.selectedIndex).data);
}

mainList.addEventListener("change",cmList);

mlist.load("topic.xml");

```

Any ideas?

I’m not attaching the file (due to file size), but if anybody wants to try to help, just drag two instances of List component to stage and name them mainList and subList.

Thanks!!

---

<div class="post-metadata">

**Author:** ![Brisa](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Brisa](https://forum.kirupa.com/u/Brisa)\
**Post date:** [April 13, 2006, 8:27pm UTC](https://forum.kirupa.com/t/xml-from-xml/185506/2 "2006-04-13T20:27:24Z")

</div>

Never mind…it was my mistake…one reference was upper case and should be lower case…

Thanks anyway:beer:
