Practical mod_perl / HTML Book /



previous page: E.4.1.2. Declarative templates
  
page up: HTML Version of the book
  
next page: E.5.1. Anatomy of an XSLT Stylesheet

E.5. XSLT


One of the most important technologies to come out of the W3C is eXtensible Stylesheet Language Transformations (XSLT). XSLT provides a way to transform one type of XML document into another using a language written entirely in XML. XSLT works by allowing developers to create one or more template rules that are applied to the various elements in the source document to produce a second, transformed document.

While the basic concept behind XSLT is quite simple (apply these rules to the elements that match these conditions), the finer points of writing good XSLT stylesheets is a huge topic that we could never hope to cover here. We will instead provide a small example that illustrates the basic XSLT syntax.

First, though, we need to configure AxKit to transform XML documents using an XSLT processor. For this example, we will assume that you already have the GNOME XSLT library (libxml2 and libxslt, available at http://xmlsoft.org/) and its associated Perl modules (XML::LibXML and XML::LibXSLT) installed on your server.

Adding this line to your httpd.conf file tells AxKit to process all XML documents with a stylesheet processing instruction whose type is "text/xsl" with the LibXSLT language module:

AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT

 

Continue to:

  • prev: E.4.1.2. Declarative templates
  • Table of Contents
  • next: E.5.1. Anatomy of an XSLT Stylesheet







TOP
previous page: E.4.1.2. Declarative templates
  
page up: HTML Version of the book
  
next page: E.5.1. Anatomy of an XSLT Stylesheet


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com