Apache

If, like over half of web masters, you're using the Apache HTTP server, you have numerous options for serving XML documents by transforming them through XSLT. These range from simple third-party modules like mod-xslt to full-blown application servers such as Cocoon and AxKit.

Cocoon started its life as a "simple servlet for XSL styling of XML content" [1] like the Saxon and Xalan servlets discussed previously. However, in the last few years it has become much more. Unlike the sample servlets discussed so far, the Cocoon application server is designed for production use. Cocoon can process every XML document a server serves, not just transforming it with XSLT but also merging in XIncludes, integrating the results of SQL queries, producing PDF output for printing, and more. It does quite a bit more than simple transformation, and it does it well.

[1] "Understanding Apache Cocoon." Accessed online in June 2003 at http://xml.apache.org/cocoon/userdocs/concepts/index.html.

Cocoon is a bit on the heavyweight side. It requires a solid servlet engine like Apache Tomcat. However, if you want a very flexible system based on XML that integrates content from many different data sources to produce output in many different formats, Cocoon is going to make your day.

Perl programmers may prefer the Apache ASP module (http://www.apache-asp.org). Like Cocoon, this provides automatic XSLT transformation capabilities and a lot more. However, it's based on Perl and Microsoft's Active Server Pages syntax rather than Java and XML. Like Cocoon, it's probably overkill if all you want to do is automatically transform a few XML documents. mod_perl is required.

Another alternative for Perl programmers is Matt Sergeant's AxKit (http://axkit.org/), another application server based on Perl that provides on-the-fly XSLT conversion of XML documents. AxKit also uses a built-in Perl interpreter so Perl code can be embedded in XML documents and executed when the page is requested . (This is like Java Server Pages or Active Server Pages except Perl replaces Java and Visual Basic.) Like Cocoon, AxKit uses pipelines to feed the output of one process into the input of the next , ultimately producing output in a variety of formats that can be customized to particular clients . Thus you could send XML and XSLT to Internet Explorer 6, XML and CSS to Opera, and plain HTML to Netscape 4. Transformations and their outputs can be optionally cached to improve performance.



Effective XML. 50 Specific Ways to Improve Your XML
Effective XML: 50 Specific Ways to Improve Your XML
ISBN: 0321150406
EAN: 2147483647
Year: 2002
Pages: 144

Similar book on Amazon

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