XML::XPathScript And AxKit


Table of Contents

From Perl-XML FAQ 
XML::XPathScript 
AxKit 
XML Publishing with AxKit 
Online Perl Programming Books — Practical mod_perl 
Your First AxKit Page 
XPathScript Details 

From Perl-XML FAQ 

http://perl-xml.sourceforge.net/faq/

XML::XPathScript 

http://perl-xml.sourceforge.net/faq/#xml_xpathscript

XPathScript is a stylesheet language comparable to XSLT, for transforming XML from one format to another (possibly HTML, but XPathScript also shines for non-XML-like output).

Like XSLT, XPathScript offers a dialect to mix verbatim portions of documents and code. Also like XSLT, it leverages the powerful "templates/apply-templates" and "cascading stylesheets" design patterns, that greatly simplify the design of stylesheets for programmers. The availability of the XPath query language inside stylesheets promotes the use of a purely document-dependent, side-effect-free coding style. But unlike XSLT which uses its own dedicated control language with an XML-compliant syntax, XPathScript uses Perl which is terse and highly extendable.

As of version 0.13 of XML::XPathScript, the module can use either XML::LibXML or XML::XPath as its parsing engine. Transformations can be performed either using a shell-based script or, in a web environment, within AxKit.

AxKit 

If you're doing a lot of XML transformations (particularly for web-based clients), you should take a long hard look at AxKit. AxKit is a Perl-based (actually mod_perl-based) XML Application server for Apache. Here are some of AxKit's key features:

  • Data can come from XML or any SAX data source (such as a database query using XML::Generator::DBI)
  • stylesheets can be selected based on just about anything (file suffix, UserAgent, QueryString, cookies, phase of the moon …)
  • transformations can be specified using a variety of languages including XSLT (LibXSLT or Sablotron), XPathScript (a Perl-based transformation language) and XSP (a tag-based language)
  • output formats can be anything you want (including HTML, WAP, PDF etc)
  • caching of transformed documents can be handled automatically or using your own custom scheme

documented on: 2006.10.09