Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display XSLT in IE 8 and Chrome with javascript and three XML files?
    primarykey
    data
    text
    <p>Internet Explorer 8: Google Chrome version 13: Javascript: XSLT: XML:</p> <p>In IE 8 nothing popluates but opera and firefox are just fine. When I load the javascript in Chrome 13.1 the first xml doc shows up and the 2nd and 3rd do not show up at all. I am referencing the three xml files in the xslt file. The javascript is from w3shools. How can I get these to populate in IE and Chrome?</p> <pre><code>Files: load_xml_javascript.html delivery_and_activity.xsl delivery.xml activity.xml click_through.xml </code></pre> <p>load_xml_javascript.html</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script&gt; function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",dname,false); xhttp.send(""); return xhttp.responseXML; } function displayResult() { xml=loadXMLDoc("delivery.xml"); xsl=loadXMLDoc("delivery_activity_clickthrough.xsl"); // code for IE if (window.ActiveXObject) { ex=xml.transformNode(xsl); document.getElementById("example").innerHTML=ex; } // code for Mozilla, Firefox, Opera, etc. else if (document.implementation &amp;&amp; document.implementation.createDocument) { xsltProcessor=new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); resultDocument = xsltProcessor.transformToFragment(xml,document); document.getElementById("example").appendChild(resultDocument); } } &lt;/script&gt; &lt;/head&gt; &lt;body onLoad="displayResult()"&gt; &lt;div id="example" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>delivery_and_activity.xsl </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!-- DWXMLSource="delivery.xml" --&gt; &lt;!DOCTYPE xsl:stylesheet [ &lt;!ENTITY nbsp "&amp;#160;"&gt; &lt;!ENTITY copy "&amp;#169;"&gt; &lt;!ENTITY reg "&amp;#174;"&gt; &lt;!ENTITY trade "&amp;#8482;"&gt; &lt;!ENTITY mdash "&amp;#8212;"&gt; &lt;!ENTITY ldquo "&amp;#8220;"&gt; &lt;!ENTITY rdquo "&amp;#8221;"&gt; &lt;!ENTITY pound "&amp;#163;"&gt; &lt;!ENTITY yen "&amp;#165;"&gt; &lt;!ENTITY euro "&amp;#8364;"&gt; ]&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype- system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/&gt; &lt;xsl:template match="/"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Delivery Summary&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h2 style="margin: 25px 0px -20px 30px; color: #003399;"&gt;Delivery Summary&lt;/h2&gt; &lt;table style="margin: 25px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; text-align:left; font-size:12px; border-collapse:collapse"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th width="165" height="30" scope="col" style="background: #b9c9fe url('left.png') left -1px no-repeat; color: #003399; padding: 8px;"&gt;Type&lt;/th&gt; &lt;th width="209" scope="col" style="background: #b9c9fe; color: #003399; padding: 8px;"&gt;% of Attempted to Deliver&lt;/th&gt; &lt;th width="90" scope="col" style="background: #b9c9fe url('right.png') right -1px no-repeat; padding: 8px; color: #003399;"&gt;Total&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tfoot&gt; &lt;/tfoot&gt; &lt;tbody&gt; &lt;xsl:for-each select="DELIVERY/SUMMARY"&gt; &lt;tr&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="TITLE"/&gt;&lt;/td&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="ATTEMPTED"/&gt;&lt;/td&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="TOTAL"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h2 style="margin: 25px 0px -20px 30px; color: #003399;"&gt;Activity Summary&lt;/h2&gt; &lt;table style="margin: 25px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; text-align:left; font-size:12px; border-collapse:collapse"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th width="165" height="30" scope="col" style="background: #b9c9fe url('left.png') left -1px no-repeat; color: #003399; padding: 8px;"&gt;Type&lt;/th&gt; &lt;th width="209" scope="col" style="background: #b9c9fe; color: #003399; padding: 8px;"&gt;% of Successfully Delivered&lt;/th&gt; &lt;th width="90" scope="col" style="background: #b9c9fe url('right.png') right -1px no-repeat; padding: 8px; color: #003399;"&gt;Total&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tfoot&gt; &lt;/tfoot&gt; &lt;tbody&gt; &lt;xsl:for-each select="document('activity.xml')/ACTIVITY/SUMMARY"&gt; &lt;tr&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="TITLE"/&gt;&lt;/td&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="ATTEMPTED"/&gt;&lt;/td&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="TOTAL"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;h2 style="margin: 25px 0px -20px 30px; color: #003399;"&gt;Click Through Report&lt;/h2&gt; &lt;table style="margin: 25px; font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif; text-align:left; font-size:12px; border-collapse:collapse"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th width="165" height="30" scope="col" style="background: #b9c9fe url('left.png') left -1px no-repeat; color: #003399; padding: 8px;"&gt;Type&lt;/th&gt; &lt;th width="209" scope="col" style="background: #b9c9fe; color: #003399; padding: 8px;"&gt;% of Successfully Delivered&lt;/th&gt; &lt;th width="90" scope="col" style="background: #b9c9fe url('right.png') right -1px no-repeat; padding: 8px; color: #003399;"&gt;Total&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tfoot&gt; &lt;/tfoot&gt; &lt;tbody&gt; &lt;xsl:for-each select="document('click_through.xml')/ACTIVITY/SUMMARY"&gt; &lt;tr&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="URL"/&gt;&lt;/td&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="UNIQUE"/&gt;&lt;/td&gt; &lt;td style="background: #e8edff; color: #003399; padding: 8px; border-top: 1px solid #fff;"&gt;&lt;xsl:value-of select="TOTAL"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>delivery.xml</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;DELIVERY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Attempted to deliver&lt;/TITLE&gt; &lt;ATTEMPTED&gt;100&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;21256&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Hard Bounces&lt;/TITLE&gt; &lt;ATTEMPTED&gt;.68&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;145&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Soft Bounces&lt;/TITLE&gt; &lt;ATTEMPTED&gt;4.48&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;953&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Successfully delivered&lt;/TITLE&gt; &lt;ATTEMPTED&gt;94.8&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;20158&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;/DELIVERY&gt; </code></pre> <p>activity.xml</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;!-- Edited by XMLSpy® --&gt; &lt;ACTIVITY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Opened&lt;/TITLE&gt; &lt;ATTEMPTED&gt;22.96&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;4629&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Clicked Through&lt;/TITLE&gt; &lt;ATTEMPTED&gt;4.10&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;829&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Replied&lt;/TITLE&gt; &lt;ATTEMPTED&gt;0.12&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;24&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Unsubscribed&lt;/TITLE&gt; &lt;ATTEMPTED&gt;0.25&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;51&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Forwarded&lt;/TITLE&gt; &lt;ATTEMPTED&gt;0.00&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;0&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;Subscribed&lt;/TITLE&gt; &lt;ATTEMPTED&gt;0.00&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;0.00&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;TITLE&gt;SpamComplaints&lt;/TITLE&gt; &lt;ATTEMPTED&gt;0.3&lt;/ATTEMPTED&gt; &lt;TOTAL&gt;6&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;/ACTIVITY&gt; </code></pre> <p>click_through.xml</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;!-- Edited by XMLSpy® --&gt; &lt;ACTIVITY&gt; &lt;SUMMARY&gt; &lt;URL&gt;navbar weddings&lt;/URL&gt; &lt;UNIQUE&gt;1&lt;/UNIQUE&gt; &lt;TOTAL&gt;1&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;URL&gt;navbar honeymoon&lt;/URL&gt; &lt;UNIQUE&gt;1&lt;/UNIQUE&gt; &lt;TOTAL&gt;1&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;SUMMARY&gt; &lt;URL&gt;submit rfp&lt;/URL&gt; &lt;UNIQUE&gt;1&lt;/UNIQUE&gt; &lt;TOTAL&gt;1&lt;/TOTAL&gt; &lt;/SUMMARY&gt; &lt;/ACTIVITY&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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