Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As alternative approach you could use simpler, non-JavaScript, browser's client side XSL tranformation, <strong>without</strong> <code>load_xml_javascript.html</code> file, just add into <code>delivery.xml</code> (just below XML declaration) following line:</p> <pre><code>&lt;?xml-stylesheet type="text/xsl" href="delivery_and_activity.xsl"?&gt; </code></pre> <p>Tested (displaying three tables) on:</p> <ul> <li>Internet Explorer 8</li> <li>Firefox 6</li> <li>Opera 11.50</li> <li>Google Chrome 13, however for local (without web server) transformations you need run browser it with <code>--allow-file-access-from-files</code> switch</li> <li>Safari 5.1</li> </ul> <hr> <p>For JavaScript based solution tables (second and third) are empty in Google Chrome 13 because <code>document()</code> function doesn't work properly under Webkit engine. Take a look at:</p> <ul> <li><a href="https://bugs.webkit.org/show_bug.cgi?id=60276" rel="nofollow noreferrer">Webkit Bug 60276</a></li> <li><a href="http://code.google.com/p/chromium/issues/detail?id=8441" rel="nofollow noreferrer">Chromium Issue 8441</a></li> </ul> <p>For Internet Explorer 8 (as well as 9) your simplified initial code looks:</p> <pre class="lang-js prettyprint-override"><code>function loadXMLDoc(dname) { var xhttp; if (window.XMLHttpRequest) xhttp = new XMLHttpRequest(); xhttp.open("GET", dname, false); xhttp.send(""); return xhttp.responseXML; } function displayResult() { var xml = loadXMLDoc("delivery.xml"); var xsl = loadXMLDoc("delivery_and_activity.xsl"); if (window.ActiveXObject) { var output = xml.transformNode(xsl); document.getElementById("example").innerHTML = output; } } </code></pre> <p>Use F12 to debug it, you should see error message (de facto the <strong>same issue</strong> as in <a href="https://stackoverflow.com/questions/5793831/script5-access-is-denied-in-ie9-on-xmlhttprequest">here</a>): </p> <blockquote> <p>Access is denied</p> </blockquote> <p>However you could try following code instead:</p> <pre class="lang-js prettyprint-override"><code>function loadXMLDoc(filePath) { var xmlDoc; if (window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; xmlDoc.validateOnParse = false; xmlDoc.load(filePath); } return xmlDoc; } function displayResult() { var xml = loadXMLDoc("delivery.xml"); var xsl = loadXMLDoc("delivery_and_activity.xsl"); if (window.ActiveXObject) { var output = xml.transformNode(xsl); document.getElementById("example").innerHTML = output; } } </code></pre> <p>To display page properly cut these attributes:</p> <pre><code>doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" </code></pre> <p>As you see it's much easier to use browser's native XSL transformation, rather than JavaScript based.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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