Friday, May 20, 2011

How Internet Explorer versions handle bad-formed XML files

Following the change from Beta to RTM Version of IE 9 in display of XML files feature we continue to work with IE using it to display XML files in certain situations.
Well, after the IE9 RC version turned back to “traditional” XML data display format, the problem seems to be solved.
But there’s a significant change in this functionality of Internet Explorer 9 and Internet Explorer CTP 10 in XML data display policy: this time it is about the bad-formed XML files.
Assume a well-formed XML file:
<element name="3" />
sample text
<element name="1" />
<element name="2" />
This file is displayed properly in IE8:
in IE9:
and in IE10:
Then we try following bad-formed XML data:
sample text
<element name="1" />
<element name="2" >
<element name="3" />

(the element [element name=”2”] has no closing tag)

This file is displayed in IE8 as expected:


The IE9 displays the same data as follows:


Neither the error notification nor any explanation are presented to the user. Via the option “View Source” you can see the source XML data, but again – no error information exists:


The same for HTML view in Developer Tools Window (activated by F12):


And only Console view:


and Script view provide us with error information:


Same behavior shows also the IE10 CTP:

x10sctmp9 x10sctmp10

Using “Force IE7” … “Force IE9” mode doesn’t affect this behavior.

The FireFox 4 displays the same well-formed XML:

and bad-formed as expected from previous FF versions:

This difference in handling of bad-formed XML data may be essential for a custom application using web browser to display XML data. Just keep it in mind…

No comments: