Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>EDIT</strong>: too bad, though all seemed fine in the preview, the clickable examples seem to mess up things... Maybe the layout is fine in the history.</p> <p>I've heard, but cannot validate for IE, that both IE and Firefox support the "view-source:" pseudo-protocol. Firefox on Mac indeed understands it, but Safari does not. </p> <p>The following bookmarklet will not trigger <a href="http://www.w3schools.com/xsl/cdcatalog_ex1.xsl" rel="nofollow noreferrer">the XSLT transformation</a> specified in <a href="http://www.w3schools.com/xsl/cdcatalog_with_ex1.xml" rel="nofollow noreferrer">the XML</a>. And though Firefox will render this using some colours, it does not execute the default transformation it would normally use for <a href="http://www.w3schools.com/XML/cd_catalog.xml" rel="nofollow noreferrer">XML without any XSLT</a> (so, the result of view-source does NOT yield a collapsable document tree that Firefox would normally show):</p> <pre><code>javascript:(function(){ var u = 'http://www.w3schools.com/xsl/cdcatalog_with_ex1.xml'; var w = window.open(); w.document.location.href = 'view-source:' + u; })() </code></pre> <p>When fetching the document using Ajax then one is not limited to the <code>alert</code> <a href="https://stackoverflow.com/questions/777784/is-there-a-way-to-have-browsers-ignore-or-override-xml-stylesheet-processing-inst/800549#800549">oneporter</a> used, but can display it in a new window as well. Again: this will not invoke the XSLT transformation that is specified:</p> <pre><code>javascript:(function(){ var u = 'http://www.w3schools.com/xsl/cdcatalog_with_ex1.xml'; var w = window.open(); /* open right away for popup blockers */ var x = new XMLHttpRequest(); x.open('GET', u, true); x.onreadystatechange = function(){ if(x.readyState == 4){ w.document.open('text/html'); /* hack to encode HTML entities */ var d = document.createElement('div'); var t = document.createTextNode(x.responseText); d.appendChild(t); w.document.write('&lt;html&gt;&lt;body&gt;&lt;pre&gt;' + d.innerHTML + '&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;'); w.document.close(); w.focus(); } }; x.send(null); })() </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