dr.swank
10-10-2002, 08:36 PM
hi all,
ok, I am getting really frustrated here. can anyone help me figure out how to store data loaded from an xml file so I can access it outside of it's parsing function. I have added my code below. this is killing me, so please, any constructive help would be really appritiated.
var xc = new Array("1", "34", "444", "sw", "sade", "adsr");
var R;
var N1;
var F1 = "F1";
var cont = new Array(F11, F12, F13, F14, F15, F16);
function myLoad() {
trace("xml declaration: "+this.xmlDecl);
trace("xml doctype: "+this.docTypeDecl);
trace("number of articles: "+this.firstChild.childNodes.length);
trace(" ");
//root
R = this.firstChild;
//root length
RL = this.firstChild.childNodes.length;
N1 = R.childNodes[3];
F11 = N1.childNodes[0].firstChild;
F12 = N1.childNodes[1].firstChild;
F13 = N1.childNodes[2].firstChild;
F14 = N1.childNodes[3].firstChild;
F15 = N1.childNodes[4].firstChild;
F16 = N1.childNodes[5].firstChild;
//---------------------------------------------
for (n=0; n<=5; n++) {
xc[n] = (eval(F1+(n+1)));
trace(xc[n]);
}
}
//---------------------------------------------------------------
jsoXML = new XML();
jXML = new XML();
jsoXML.ignoreWhite = true;
jsoXML.onLoad = myLoad;
jsoXML.load("jsoXML.xml");
thanx in advance all.
the doctor
ok, I am getting really frustrated here. can anyone help me figure out how to store data loaded from an xml file so I can access it outside of it's parsing function. I have added my code below. this is killing me, so please, any constructive help would be really appritiated.
var xc = new Array("1", "34", "444", "sw", "sade", "adsr");
var R;
var N1;
var F1 = "F1";
var cont = new Array(F11, F12, F13, F14, F15, F16);
function myLoad() {
trace("xml declaration: "+this.xmlDecl);
trace("xml doctype: "+this.docTypeDecl);
trace("number of articles: "+this.firstChild.childNodes.length);
trace(" ");
//root
R = this.firstChild;
//root length
RL = this.firstChild.childNodes.length;
N1 = R.childNodes[3];
F11 = N1.childNodes[0].firstChild;
F12 = N1.childNodes[1].firstChild;
F13 = N1.childNodes[2].firstChild;
F14 = N1.childNodes[3].firstChild;
F15 = N1.childNodes[4].firstChild;
F16 = N1.childNodes[5].firstChild;
//---------------------------------------------
for (n=0; n<=5; n++) {
xc[n] = (eval(F1+(n+1)));
trace(xc[n]);
}
}
//---------------------------------------------------------------
jsoXML = new XML();
jXML = new XML();
jsoXML.ignoreWhite = true;
jsoXML.onLoad = myLoad;
jsoXML.load("jsoXML.xml");
thanx in advance all.
the doctor