An XML toolkit for Web servers (5/5) - exploring XML | WebReference

An XML toolkit for Web servers (5/5) - exploring XML

An XML toolkit for Web servers

XML Enabler

XML Enabler, also from IBM Alphaworks, is a servlet that takes an HTTP request from a browser, and scans the HTTP header to determine which type of browser made the request. The servlet then selects one of a collection of XSL stylesheets, uses it to transform the data into HTML and sends back the result. That way you can optimize the HTML output for that specific browser and render XML data in virtually any browser. Once you've installed the tools described here, you need to define a mapping between browser types you want to support and their corresponding stylesheets.

After you have downloaded the XMLEnabler archive and unpacked the file, add support for this servlet to your servlet engine. The exact procedure depends on the particular server. However, most servers support a servlet.properties file where servlets are associated with their respective Java classes. If you're using the ServletRunner from the JSDK, add this line to your servlet.properties file:

servlet.xmlenabler.code=com.ibm.XMLEnabler.XMLEnabler

Also place the XMLEnabler JAR file in your servlets directory. You should now be able to access XMLEnabler through your browser with the servlet engine running in the background. You pass the name of the XML document as a parameter in the URL:

http://localhost:9000/servlet/com.ibm.XMLEnabler.XMLEnabler?URL=http://localhost/test.xml

Conclusion

Client-side processing of XML has only limited appeal, for instance in an all-Explorer intranet environment. For the big World-Wide Web however, server-side XML is the way to go. The collection of tools detailed in this article is all you need to get going.

Here are the download locations again for your convenience: