简体   繁体   中英

xml/xsl not loading in IE11. Trying to forcing compatibility mode on xml/xsl page

I have a page that contains xml from an xsl document. It does not work on IE11 (the page is blank. when I view the source, the xml is there) but works on IE8. When I add the site to compatibility mode, this page works fine.

What I need to do is force compatibility mode on this page only. The ua-compatible meta tag has not effect. What can I do to force compatibility mode?

<%@ taglib uri='http://java.sun.com/jstl/core' prefix='c' %>
<?x-ua-compatible content="IE=Edge"?> //does not work

<% response.setContentType("text/xml; charset=UTF-8"); %>
<?xml-stylesheet type="text/xsl" href="xsl/my_xsl.xsl"?>
<c:out value="${xmlDataFromRequest}" escapeXml="Y"/>

edit:

I have tried content="IE=EmulateIE8" and content="IE=8" but it doesn't work.

Microsoft has a knowledge base article on this.

Internet Explorer may not display local XML content

Symptoms

The XML document loads an XSL or XSLT style sheet from the local Windows file system.

Resolution

To resolve this problem in Windows 8.1, Windows Server 2012 R2, Windows 8, or Windows Server 2012, install the most recent cumulative security update for Internet Explorer.

Further reading

https://support.microsoft.com/en-us/kb/2974524

The issue turned out to be duplicate xml declarations in the document. IE8 seems to tolerate this where as ie9+ do not.

I was able to see the error message by doing F12 it said something like "xml declaration should be at the start of the document" it was at the start but there was a second declaration below it.

to fix it I simply removed the second declaration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM