7

I know very little about ASP.NET, have to fix some broken layout in some ASP.NET webforms though. The following code:

<head id="Head1" runat="server">
...
<xml id="dataList_xsl">
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:extObject="urn:extObject">
<xsl:output method="html" />
<xsl:template match="/">
    <table unselectable="on" id="my_table_mains" cellspacing="0" cellpadding="3" class="dataListTable view" style="width: 100%;"> 
        <tr unselectable="on">
            COLUMNS_DEFINITION
        </tr>
...

should display NOTHING in the case of no match, and so it was in Internet Explorer 8, however it displays the "COLUMNS_DEFINITION" in the newer versions of IE. How can I fix it?
I get a validation error on the tag - Element 'xml' not supported, btw.

1 Answer 1

6

I don't think it has anything to do with ASP.NET. IE (Internet Explorer) used to support an extension to HTML, so called XML data islands, where you put XML data or stylesheets into a new, proprietary element to HTML, the xml element. If you want to continue to use that element and have newer versions of IE support it then you need to make sure you set the x-ua-compatible to IE 8, either by sending the HTTP header or by including a meta:

<head>
  <meta http-equiv="x-ua-compatible" content="IE=8">

See http://msdn.microsoft.com/en-us/library/jj676915%28v=vs.85%29.aspx for details.

I wrote two test cases, with http://home.arcor.de/martin.honnen/html/test2013112001.html IE 10 on Windows 8 shows the content of the XSLT inside the xml element as the HTML 5 parser it has moves the xml stuff in the head section to the body (press F12 to see the parse tree) while with http://home.arcor.de/martin.honnen/html/test2013112002.html and the meta enforcement to use IE 8 the xml is recognized as an XML data island (press F12 to see parse tree) and does not output content inside of the XML data island.

Greg, if you still have problems then check that your ASP.NET is not sending a different HTTP x-ua-compatible header that might override the meta.

Here is a link: http://msdn.microsoft.com/en-us/library/ie/hh801224%28v=vs.85%29.aspx. It suggests a slightly different meta <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">, in the end it amounts to ensure that the legacy parser is used that recognizes an xml element as an XML data island.

Sign up to request clarification or add additional context in comments.

3 Comments

@Greg Martin is suggesting that you add that tag to your head element because it will cause IE 10 to behave like IE8 for that specific page.
@Greg, I posted links to two test cases showing that my suggestion with the meta should help. If you still have problems then maybe post a URL or check yourself whether your server perhaps sends a x-ua-compatible overriding the meta. Or at least use developer tools (F12) in IE 10 to tell use the browser mode and document mode.
Cheers, hopefully I can test it today.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.