Copy link to clipboard
Copied
I am using html5 Canvas output and createJS.
This is the XML i am trying to read
<Tour>
<Day Seq="1">
<man1>name1</man1>
<man2>name2</man2>
<man3>name3</man3>
</Day>
<Day Seq="2">
<man1>name1</man1>
<man2>name2</man2>
</Day>
<Day Seq="3">
<man1>name1</man1>
<man2>name2</man2>
<man3>name3</man3>
<man4>name4</man4>
</Day>
<Tour>
My code is :
var reqCurrent = new XMLHttpRequest();
reqCurrent.open("GET", "xxx.xml", true);
reqCurrent.addEventListener("load", fLoader);
reqCurrent.send();
function fLoader(e) {
parserM = new DOMParser();
xmlDocM = parserM.parseFromString(e.target.response, "text/xml");
}
I can read, i mean the code is ok.
Now my problem is to read this file even if number of day will increase with a random number of man.
can someone help me?
Thanks in advance.
Copy link to clipboard
Copied
google how to traverse an xml file.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now