# XML Help - xml structure

**URL:** https://forum.kirupa.com/t/xml-help-xml-structure/330942
**Category:** flash
**Created:** [April 14, 2013, 5:17am UTC](https://forum.kirupa.com/t/xml-help-xml-structure/330942 "2013-04-14T05:17:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![daejeon](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@daejeon](https://forum.kirupa.com/u/daejeon)
#### Post date: [April 14, 2013, 5:17am UTC](https://forum.kirupa.com/t/xml-help-xml-structure/330942/1 "2013-04-14T05:17:59Z")

</div>

I’ve started looking into an old project that I stopped midway. I’ve never been good with xml, and I can’t remember for the life of me how I structured the xml for this particular file.

```auto

function loadCategories(topic)
{
    thisFolder = topic;
    categoriesLoader.load("words.xml");
}
function parseCategories(thisFolder)
{
    allCategories.splice(0);
    if (categoriesLoader.firstChild.nodeName == "gamedata")
    {
        var _loc1 = categoriesLoader.firstChild;
        var _loc3 = 1;
        for (j = 0; j < _loc1.childNodes.length; j++)
        {
            if (_loc1.childNodes[j].nodeName == thisFolder)
            {
                allCategories[0] = _loc1.childNodes[j].childNodes[0].nodeName.toString();
                for (i = 1; i < _loc1.childNodes[j].childNodes.length; i++)
                {
                    if (_loc1.childNodes[j].childNodes*.nodeName != _loc1.childNodes[j].childNodes[i - 1].nodeName)
                    {
                        allCategories[_loc3++] = _loc1.childNodes[j].childNodes*.nodeName.toString();
                    }
                }
                if (thisFolder == "FirstFolder")
                {
                    createFolderText();
                    continue;
                }
            }
        }
    }
}
function parseWords()
{
    if (wordsLoader.firstChild.nodeName == "gamedata")
    {
        words.splice(0);
        categoryArray.splice(0);
        folderArray.splice(0);
        var _loc1 = wordsLoader.firstChild;
        numWordsLoaded = 0;
        for (j = 0; j < _loc1.childNodes.length; j++)
        {
            if (_loc1.childNodes[j].nodeName == thisFolder)
            {
                for (i = 0; i < _loc1.childNodes[j].childNodes.length; i++)
                {
                    if (_loc1.childNodes[j].childNodes*.nodeName == rolledOver)
                    {
                        var _loc2 = _loc1.childNodes[j].childNodes*.firstChild.nodeValue.toString();
                        words.push(_loc2);
                        folderArray.push(thisFolder);
                        categoryArray.push(rolledOver);
                        ++numWordsLoaded;
                        continue;
					}
                    ++_loc1.childNodes[j].childNodes;
                }
            }
        }
        wordList.showList();
    }
}

```
