Hi!

I have a problem here...

Please someone have a look at my xml-loading and parsing and tell me why that works when I use it on base-level (0) but when having it loaded into a higher level (e.g. _level2) it doesn´t ...

I am fighting with this for hours now, but I can´t find the bug.

Here´s the code:

this.onLoad = function() {
XMLobj = new XML();
XMLobj.onLoad = loadXML;
XMLobj.load("koi.xml");
XMLobj.ignoreWhite=true;
};
function loadXML(success) {
var i, nodeObj;
if (success) {
output = "File has been loaded";
amount = this.firstChild.childNodes.length;
Datenbankgroesse=amount;
List.setRowCount(amount);
Datas = new Array();
FotoArray = new Array();
CodeArray = new Array();
VarieArray = new Array();// Nummernvergabe
VarieArray2 = new Array();//Varietätenname
VarieArray3 = new Array();//Unternamen
MerkmalArray = new Array();
AlterArray = new Array();
ZuechterArray = new Array();
LfdArray = new Array();

for (i=0; i<amount; i++) {
nodeObj = this.firstChild.childNodes[i];

VarieArray[i] = nodeObj.attributes.varie;
if (VarieArray[i].charAt(0) == "0") {
VarieArray2[i] = "Gosanke";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Kohaku";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Sanke";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Showa";
}

} else if (VarieArray[i].charAt(0) == "1") {
VarieArray2[i] = "Utsurimono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Shiro Utsuri";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Hi Utsuri";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Ki Utsuri";
}
} else if (VarieArray[i].charAt(0) == "2") {
VarieArray2[i] = "Utsurimono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Bekko";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Asagi";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Koromo";
}
} else if (VarieArray[i].charAt(0) == "3") {
VarieArray2[i] = "einfarbige Kawarimono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Chagoi";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Karashigoi";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Benigoi";
}else if (VarieArray[i].charAt(1) == "4") {
VarieArray3[i] = "Kigoi";
}else if (VarieArray[i].charAt(1) == "5") {
VarieArray3[i] = "Midorigoi";
}else if (VarieArray[i].charAt(1) == "6") {
VarieArray3[i] = "Soragoi";
}else if (VarieArray[i].charAt(1) == "7") {
VarieArray3[i] = "Karasugoi";
}
} else if (VarieArray[i].charAt(0) == "4") {
VarieArray2[i] = "mehrfarbige Kawarimono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Goshiki";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Kumonryu";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Ochiba Shigure";
}else if (VarieArray[i].charAt(1) == "4") {
VarieArray3[i] = "Aka Matsuba";
}else if (VarieArray[i].charAt(1) == "5") {
VarieArray3[i] = "Ki Matsuba";
}else if (VarieArray[i].charAt(1) == "6") {
VarieArray3[i] = "Kikokuryu";
}else if (VarieArray[i].charAt(1) == "7") {
VarieArray3[i] = "Benikumonryu";
}else if (VarieArray[i].charAt(1) == "8") {
VarieArray3[i] = "Benikikokuryu";
}
} else if (VarieArray[i].charAt(0) == "5") {
VarieArray2[i] = "Hikarimuji-mono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Platinum Ogon";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Yamabuki Ogon";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Orenji Ogon";
}else if (VarieArray[i].charAt(1) == "4") {
VarieArray3[i] = "Nezu Ogon";
}else if (VarieArray[i].charAt(1) == "5") {
VarieArray3[i] = "Matsuba Ogon";
}else if (VarieArray[i].charAt(1) == "6") {
VarieArray3[i] = "Gin Matsuba";
}else if (VarieArray[i].charAt(1) == "7") {
VarieArray3[i] = "Kin Matsuba";
}else if (VarieArray[i].charAt(1) == "8") {
VarieArray3[i] = "Mizuho Ogon";
}
} else if (VarieArray[i].charAt(0) == "6") {
VarieArray2[i] = "Hikarimoyo-mono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Kujaku";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Yamatonishiki";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Hariwake";
}else if (VarieArray[i].charAt(1) == "4") {
VarieArray3[i] = "Kikusui";
}else if (VarieArray[i].charAt(1) == "5") {
VarieArray3[i] = "Yamabuki Hariwake";
}else if (VarieArray[i].charAt(1) == "6") {
VarieArray3[i] = "Doitsu Yamabuki";
}else if (VarieArray[i].charAt(1) == "7") {
VarieArray3[i] = "Hariwake";
}
} else if (VarieArray[i].charAt(0) == "7") {
VarieArray2[i] = "Hikari-utsurimono";
if (VarieArray[i].charAt(1) == "1") {
VarieArray3[i] = "Kin Showa";
}else if (VarieArray[i].charAt(1) == "2") {
VarieArray3[i] = "Gin Shiro";
}else if (VarieArray[i].charAt(1) == "3") {
VarieArray3[i] = "Kin Ki Utsuri";
}
}
MerkmalArray[i] = nodeObj.attributes.merkmale;
if (nodeObj.attributes.merkmale == "ohne Angaben") {
MerkmalArray[i] = "X";
}
AlterArray[i] = nodeObj.attributes.alter;
ZuechterArray[i] = nodeObj.attributes.zuechter;
if (nodeObj.attributes.zuechter == "ohne Angaben") {
ZuechterArray[i] = "XXX";
}
LfdArray[i] = nodeObj.attributes.lfd;
CodeArray[i] = VarieArray[i]+"-"+(MerkmalArray[i].charAt(0))+"-"+AlterArray[i]+"-"+((ZuechterArray[i].substr(0,3)).toUpperCase())+"-"+LfdArray[i];
FotoArray[i] = CodeArray[i]+".jpg";

Datas[i] = "File: "+FotoArray[i]+"<br>";
Liste.addItem(VarieArray3[i], Datas[i]);
}
menuLoaded = true;
Liste.sortItemsBy("label", "ASC");
_root.headline="Koi-Database [temporarely "+ Datenbankgroesse +" inserted Koi]";
} else {
output = "XML-Document failed to load!";
}
}


I use this code to load the xml-file "koi.xml" and then let 4 combo-boxes be filled with search-terms like Varietät, Züchter, Alter, etc..
The user then can choose the Combo-Box-labels to recieve all the koi that have terms like the choosen one in their base-code.
Sounds complicated but is very easy so far.

Only problem is like I said before:
It works well on _level0, but on other higher levels it doesn´t.

Please tell me someone why!!!!

Thanks alot,

Manuel