Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

XML Files : read by tag

Community Beginner ,
May 18, 2021 May 18, 2021

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.

122
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2021 May 18, 2021
LATEST

google how to traverse an xml file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines