Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want to display the information for each Document, you would want something like this:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function getMyXML() { console.log("viewXMLFiles() is running"); xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","TestInfo.xml",false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; console.log("still running"); console.log("getting tired"); document.getElementById("docname").innerHTML = xmlDoc.getElementsByTagName("document_name")[0].childNodes[0].nodeValue; document.getElementById("filetype").innerHTML = xmlDoc.getElementsByTagName("file_type")[0].childNodes[0].nodeValue; document.getElementById("docname2").innerHTML = xmlDoc.getElementsByTagName("document_name")[1].childNodes[0].nodeValue; document.getElementById("filetype2").innerHTML = xmlDoc.getElementsByTagName("file_type")[1].childNodes[0].nodeValue; console.log("done"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" onclick="getMyXML();" value="Get XML" /&gt; &lt;div id="doclist"&gt; &lt;h2&gt;Document 1&lt;/h2&gt; &lt;label&gt;Docname: &lt;/label&gt;&lt;span id="docname"&gt;&lt;/span&gt;&lt;br/&gt; &lt;label&gt;Filetype: &lt;/label&gt;&lt;span id="filetype"&gt;&lt;/span&gt;&lt;br/&gt; &lt;/div&gt; &lt;div id="doclist"&gt; &lt;h2&gt;Document 2&lt;/h2&gt; &lt;label&gt;Docname: &lt;/label&gt;&lt;span id="docname2"&gt;&lt;/span&gt;&lt;br/&gt; &lt;label&gt;Filetype: &lt;/label&gt;&lt;span id="filetype2"&gt;&lt;/span&gt;&lt;br/&gt; &lt;/div&gt; &lt;/body&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload