I am new to JavaScript and I am trying to read an XML file and extract its content into JavaScript variables.
Here is an example of the content of my XML file:
<!-- Locations of current projects -->
<projectsites>
<li>
<title>Battling Ninja Army</title>
<location>Osaka, Japan</location>
<lat>34.69</lat>
<lon>135.50</lon>
</li>
<li>
<title>Software Development</title>
<location>Vienna, Austria</location>
<lat>48.21</lat>
<lon>16.37</lon>
</li>
</projectsites>
<!-- Locations of current developers -->
<developersites>
<li>
<title>Brisbane office</title>
<location>Brisbane, Australia</location>
<lat>-27.4</lat>
<lon>153</lon>
</li>
<li>
<title>Phillipines Office</title>
<location>Manilla, Phillipines</location>
<lat>14.7</lat>
<lon>121</lon>
</li>
</developersites>
So, presuming that I have more data than this, can I create a loop or nested loops in JavaScript that reads the XML file and extracts the data into arrays? Examples of elements that I am interested in are: projectsites.title, projectsites.lat, developersites.title and developersites.lat.
xmlhttprequest cannot load [filename].xls Origin null is not allowed by access-control-allow-origin