Serving Web Content with AxKit


First, let me say that AxKit is an outstanding piece of work ”it has become the de facto standard for XML content delivery and publishing. AxKit was originally developed by Matt Sergeant and is now maintained and developed by a number of developers.

Before I discuss installing and configuring all the components required for AxKit, let's take a little time and discuss how AxKit actually works. AxKit uses XML processing to generate and process that allows XML content delivery in a variety of formats. Although AxKit can be used to deliver non-XML formats, most of the time it is used to deliver XML formatted documents.You already know that XML is great for content storage and retrieval, especially in web-based systems, but there are a number of advantages to using XML for server-side processing. Let's take a look at a few of these advantages.

XML can be easily transformed to a number of formats. For example, an XML document can be transformed to another XML document, WML, HTML, CSV, PDF, or a number of other formats. Even if you have control over the clients , it may make more sense to perform all transformation at a single location (that is, at a server).

Source data can be transformed to a number of different formats (or versions of the same format) to support clients with different capabilities. For example, let's assume you need to generate HTML documents to support two clients: a standard PC and a PDA. The HTML document for the PDA might present the source information a little differently from the HTML document used on a standard PC.

XML supports different character encodings, so the same source data can be viewed using a different character encoding (depending on client browser support).

XML is rapidly increasing in popularity. So, it makes sense to move toward this as a standard for document processing. In addition, because XML is an open standard, it is becoming easier and easier to find new employees who are fluent in XML.

So, how does AxKit tie all these things together? A high-level view of the data transaction data flow with AxKit is shown in Figure 9.1.

Figure 9.1. AxKit process.

graphics/09fig01.gif

Starting on the right side of Figure 9.1, a client initiates a request to an Apache web server (that has AxKit installed) for a particular web page. Note that the client can be a browser or any other network application. AxKit then checks to see if the requested document is already cached. If the requested document has been cached (that is, requested once already and stored again for future use), then the cached version of the requested document is returned to the client. The benefit of using a cached copy is that it saves transformation time.

It is important to note that AxKit isn't limited to XML source documents. Non-XML documents and data sources can be converted to XML whenever required.Valid source data for AxKit includes a text file, the results of a database query, a Perl subroutine, or any number of other sources.

When AxKit receives a new request (that is, not cached), it retrieves and processes the requested page as needed. AxKit applies any required XSLT stylesheets to the source data to generate the required documents. AxKit then caches the results and checks to see if the requesting client supports compressed data. If so, then AxKit compresses the results and sends them back to the client. If the client doesn't support compressed data, AxKit returns the uncompressed results. AxKit has a number of complex features, but in our example, I'll demonstrate the most common basic XML content delivery.

For more information on AxKit, please visit http://www.axkit.org. Now that you've had a brief overview of AxKit, let's install, configure, and then run our example.



XML and Perl
XML and Perl
ISBN: 0735712891
EAN: 2147483647
Year: 2002
Pages: 145

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net