XSL Device Formatting Using the Microsoft XSL ISAPI Filter
The XSL ISAPI filter is an extension to Microsoft's Internet Information Services that simplifies the deployment of server-side XSL stylesheets. In this article Jean shows us how to download, configure and use the XSL ISAPI filter to generate output for different devices automatically from IIS, including web browsers and WAP compatible phones.
XSL Device Formatting Using the Microsoft XSL ISAPI Filter - Installing the filter (Page 2 of 4 )
The XSL ISAPI filter can be installed on both Windows 2000 Server and Windows 2000 Advanced Server. I also tested the filter on a Windows 2000 Professional however, and it works just fine. The filter may also work on a Windows NT 4.0 box but some limitations (the HTTP post method not being supported for example) make it nearly unusable.
You must have MSXML 2.5 (or greater) installed on your PC before installing the filter. Download the Microsoft XSL ISAPI filter here. Extract the file to a directory on your hard drive and register the xslisapi2.dll file with regsvr32 (start -> run -> "regsvr32 c;\path\to\file\xslisapi2.dll").
Do the following on the properties page of the the IIS administration tool (start -> run -> "mmc" then load the IIS snap-in):
Click on the ISAPI tab and add a new filter by giving it a name and by browsing to the xslisapi2.dll file.
Click OK twice.
If you come back to the ISAPI tab then you should see a green arrow in the status field, as shown here:
Create a New virtual directory called xslisapi and set its root to the folder where you expanded the files. You can use the wizard to do this if you wish.
Test your installation by navigating to the installtest.pasp (which is installed with the filter) page in your browser:
Note that the XSL ISAPI filter will write files into the directory where .pasp files reside. Thus, if you have restricted directory permissions then you must change them to allow for this. You must also copy RedirectorPASP.asp into each directory that will contain .pasp files.
There's one more thing that you must do to achieve support for each device that you want your XSL stylesheets to facilitate. You must add information about the devices that will access your application (including their name, markup-language used, content-type to send, etc.) to IIS's browsecap.ini file, which typically resides in c:\winnt\system32\inetsrv.
The sample application that we're about to create will be reachable from the web and a WAP enabled browser (Openwave). I added the following lines to the end of my browsecap.ini file:
; Phone.com SDK Simulator v 4 BETA for WML
; Openwave SDK 5.0
browser=Openwave SDK 5.0 simulator
Please note that IE is already defined (as are many common Web browsers) in the browscap.ini file.
We've been raving on about the XSL ISAPI filter, but why would you as a developer want to use it? The main features of the XSL ISAPI filter are shown below:
Automatic execution of XSL stylesheets on the server, based on device types.
Dynamic generation of XML via ASP.
Chained execution of several stylesheets.
Configurable content-type, output encoding and character-sets.
Customizable error messages.
Support for the XSLTemplate object.
The most impressive feature of the XSL ISAPI filter is its ability to generate XML on the fly – after which the XSL stylesheet is employed for presentation on the selected device.
The steps that the XSL ISAPI filter takes are shown below:
XML is generated from a file with the .pasp extension.
The resulting XML file is loaded.
The associated configuration file is read and the matching device chosen.
The associated XSL stylesheet is applied.
Post processes are executed (processing escape symbols, etc).
The response object (WML, HTML, etc) is sent to the device.