An XML toolkit for Web servers (1/5) - exploring XML
An XML toolkit for Web servers
A lot of software is available today for processing XML data. And most of it is free of charge. This article describes an easy way to XML-enable your Web server. Just follow these four simple steps:
- Install Java on your Web server
- Enable servlets
- Install a Java XSL processor
- Install an XML-HTTP servlet
Server-side XML
A big discussion came up recently on the advantages and shortcomings of client-side vs. server-side XML processing. A matter of fact is that XML support varies widely in today's Web browsers. The situation is actually worse than with HTML 4 because this standard is covered in two documents at the W3C, namely the HTML and CSS specifications. On the other hand XML consists of various technologies built on top of each other, for instance XPath and XSL, which can be implemented fully, partially or not at all in any given product.
My recommendation is to use client-side XML only in tightly controlled intranet environments, where for instance only Internet Explorer 5 is used (in only the same sub-version, and only on one platform ...). In all other case you are much better off in processing XML on the server and then use the well-known browser-detection techniques to tailor the output to the capabilities of the client. This can go from passing through the full XML all the way to completely transforming it into DHTML. By the way, XSL-T is a good technology for producing these transformations.
Server-side Java
Most Web-servers, including the venerable machine that you get these pages from, run with Common Gateway Interface (CGI) and Server-Side Includes (SSI). While these are proven and well-working technologies they have one difficulty: Every server environment is unique and therefore quite difficult to reproduce on another machine, especially if this machine runs on another platform.
I use a Windows laptop to create, stage and preview my column, and spent quite some time and effort on creating a situation where my machine produced the same results as the Web Reference server. Many tools that are readily available on UNIX don't come with Mac, or Windows, or are only available as separate packages. Even differences between UNIX installations such as different paths to a shell program or the Perl interpreter can cause CGIs to fail.
This is where Java shines: Installing a Java virtual machine creates a uniform runtime environment on any platform for which a JVM exists. The included set of APIs works the same everywhere.
Let's install Java on your Web server.
Produced by Michael Claßen
All Rights Reserved. Legal Notices.
URL: https://www.webreference.com/xml/column18/index.html
Created: Aug 27, 2000
Revised: Aug 27, 2000