WebReference.com - Part 1 of chapter 12 of XSLT Developer's Guide, from Osborne/McGraw-Hill (2/6) | WebReference

WebReference.com - Part 1 of chapter 12 of XSLT Developer's Guide, from Osborne/McGraw-Hill (2/6)

To page 1current pageTo page 3To page 4To page 5To page 6
[previous] [next]

XSLT Developer's Guide

Browser Support for XSLT

Although the XSLT 1.0 specification has been around for over two years as of this writing, the browsers took a while to catch up with the specification. The standard installation of Internet Explorer prior to version 6.x did not support XSLT 1.0.

Starting with Internet Explorer (IE) 5.0, Microsoft provided support for its own set of nonstandard, XSLT-like elements using the MSXML parser. We say XSLT-like to distinguish the Microsoft specification from the true W3C specification of XSLT. To be fair to Microsoft, IE5.0 was shipped in 1998 with the built-in MSXML parser version 1.0 prior to the finalization of the W3C specification, which happened in November 1999. So in this circumstance, we will give Microsoft the benefit of the doubt and say that the company did its best to support a truly emerging standard that was in a state of flux. In that case, however, it is mildly perplexing that even with the release of IE5.5, Microsoft still had not implemented W3C's specification in its parser. Only with release 3.0 of the MSXML parser did IE come closer to supporting standard XSLT. This MSXML3 implementation was released in November 2000, a year after W3C released the final 1.0 specification, and even then, it was the end user's responsibility to download the new version of the XSLT parser from Microsoft's XML Development Center and install it in replace mode before testing the use of client-side XSLT. Naturally, developers could not assume that all end users would use IE, or even that all IE users would upgrade to MSXML3, and hence hesitated to use client-side XSLT.

Microsoft's first release of the MSXML parser embedded in IE5.0 made reference to the old XSLT namespace as shown in the following code sample:


This was corrected later when MSXML 3.0 supported the correct XSLT namespace:


IE6.0 comes bundled with a parser that supports XSLT. Of course, as is the case with most other Microsoft products, IE6.0 supports several nonstandard XSLT-like tags that you would be well advised to stay away from. This suggestion is not simply for the purists, but for other XSLT practitioners as well since your potential user community will generally use a variety of different types of browsers, and it will be in your interest to stick to the standard XSLT specification.

Netscape Navigator (NN), despite all its other strengths, did not fare much better in providing support for client-side XSLT in version 4.7x, which is probably the most widely installed version of NN as of this writing. XSLT plug-ins have been available as third-party products, but to our knowledge, NN 4.7x did not have a production- release browser plug-in that came from Netscape itself. Only with NN6.x was the client-side support for XSLT provided. The examples in the previous chapters were also tested using Netscape 6.1, and they all seemed to work well.

The Correct MIME Type?

W3C's XSLT 1.0 specification states that the MIME media types text/xml and application/xml should be used. This makes sense since an XSLT document itself is an XML document. The specification further says that a separate media type (then unspecified) will be registered specifically for XSLT stylesheets, in which case the new media type may also be used. Alas, as of early 2002 neither of the major browsers will work if you use text/xml. You must use the text/xsl MIME media type to take advantage of the client-side XSLT support.

IE6.0 does support XSLT, albeit two years after the XSLT 1.0 specification was finalized. The browser recognizes application/xml as a valid application type. However, it still incorrectly assumes that the mime of text/xsl is valid and does not recognize the valid mime type text/xml. Interestingly, NN6.1 does not differ much from IE6.0 in the implementation of these mime types, either. We must say here that W3C's XSLT specification states that the MIME types text/xml and application/xml should be used for XSLT stylesheets. The specification further states that a media type will be registered specifically for XSLT stylesheets, and that new media type may also be used at that time. Since the name of the new MIME type for XSLT stylesheets is not finalized yet, we are not surprised that the browser vendors have provided support for the media type with the possible name text/xsl, although we would have expected support for the media type text/xml as well.

To page 1current pageTo page 3To page 4To page 5To page 6
[previous] [next]

Created: May 28, 2002
Revised: May 28, 2002

URL: http://webreference.com/authoring/languages/xml/xsltdev/chap12/1/2.html