Simbiot
01-18-2003, 03:18 PM
Hi everyone,
I'm trying to alter a piece of actionscript code that handles xml data.
I'm currently using a simple method but I want to expand that.
CURRENT VERSION:
CURRENT DATA
<xml etc.....>
<child title="child1">
<decendant title="decendant1.1.1"></decendant>
<decendant title="decendant1.1.2"></decendant>
</child>
<child title="child1.1">
<decendant title="decendant1.1.1"></decendant>
<decendant title="decendant1.1.2"></decendant>
</child>
</xml>
CURRENT CODE
I'm keeping it basic just to get the idea across. This is a multidimensional function.
for (i=0; i<myXML.firstChild.childNodes.length; i++) {
title= (myXML.firstChild.childNodes[i].attributes.title);
for (j=0;j<myXML[title].childNodes.length;j++){
title = (myXML[title].childNodes[j].attributes.title);
}
}
FUTURE VERSION
FUTURE DATA
<xml etc.....>
<parent title="parent1">
<child title="child1.1">
<decendant title="decendant1.1.1"></decendant>
<decendant title="decendant1.1.2"></decendant>
</child>
<child title="child1.2">
<decendant title="decendant1.2.1"></decendant>
<decendant title="decendant1.2.2"></decendant>
</child>
</parent>
<parent title="parent2">
<child title="child2.1">
<decendant title="decendant2.1.1"></decendant>
<decendant title="decendant2.1.2"></decendant>
</child>
<child title="child2.2">
<decendant title="decendant2.2.1"></decendant>
<decendant title="decendant2.2.2"></decendant>
</child>
</parent>
</xml>
FUTURE CODE
?????? Can anyone help me out??????
I'm trying to alter a piece of actionscript code that handles xml data.
I'm currently using a simple method but I want to expand that.
CURRENT VERSION:
CURRENT DATA
<xml etc.....>
<child title="child1">
<decendant title="decendant1.1.1"></decendant>
<decendant title="decendant1.1.2"></decendant>
</child>
<child title="child1.1">
<decendant title="decendant1.1.1"></decendant>
<decendant title="decendant1.1.2"></decendant>
</child>
</xml>
CURRENT CODE
I'm keeping it basic just to get the idea across. This is a multidimensional function.
for (i=0; i<myXML.firstChild.childNodes.length; i++) {
title= (myXML.firstChild.childNodes[i].attributes.title);
for (j=0;j<myXML[title].childNodes.length;j++){
title = (myXML[title].childNodes[j].attributes.title);
}
}
FUTURE VERSION
FUTURE DATA
<xml etc.....>
<parent title="parent1">
<child title="child1.1">
<decendant title="decendant1.1.1"></decendant>
<decendant title="decendant1.1.2"></decendant>
</child>
<child title="child1.2">
<decendant title="decendant1.2.1"></decendant>
<decendant title="decendant1.2.2"></decendant>
</child>
</parent>
<parent title="parent2">
<child title="child2.1">
<decendant title="decendant2.1.1"></decendant>
<decendant title="decendant2.1.2"></decendant>
</child>
<child title="child2.2">
<decendant title="decendant2.2.1"></decendant>
<decendant title="decendant2.2.2"></decendant>
</child>
</parent>
</xml>
FUTURE CODE
?????? Can anyone help me out??????