PRB: XML Viewer Is Not Used for XML File (234207)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5

This article was previously published under Q234207

SYMPTOMS

When Internet Explorer navigates to an XML file, it does not display the XML in the browser with the default XML viewer.

CAUSE

The Web server and the XML file are not specifying enough information for Internet Explorer to detect that the file contains XML text.

RESOLUTION

Internet Explorer requires at least one of the following points to correctly detect that a file contains XML text and display the file in the built-in XML viewer:
  • The server-specified HTTP Content-Type header is equal to "text/xml".
  • The file ends in an .xml extension.
  • The beginning of the file contains the standard XML declaration beginning "<?xml".
To resolve this problem, make sure that the XML resource follows one of these points.

Active Server Pages (ASP) pages that return XML information can easily return the correct content type using the ContentType property of the Response object:
<%Response.ContentType = "text/xml"%>
				
You must add this line of code to the absolute top of the ASP page.

A standard XML declaration may appear as follows:
<?xml version="1.0" ?>

Modification Type:MajorLast Reviewed:10/12/2001
Keywords:kbDSupport kbMSXMLnosweep kbprb KB234207 kbAudDeveloper