![]() |
|
|
Sample Document TransformationsNow, we're going to see how AxKit works by transforming an XML file containing data about Camelids (note the dubious Perl reference) into HTML. Step 1 - A Sample XML Document
First, you will need a sample XML file. Open the text editor of your choice
and type the following:
Step 2 - Create a StylesheetNow, create the stylesheet to transform your XML document. If you have chosen to install Sablotron or one of the other XSLT processors that AxKit supports you may use either the XSLT or XPathScript samples below. If you have not installed an XSLT processor skip directly to the XPathScript example. Using XSLT
Start a new file and type the following:
Using XPathScript
Create a new file and type:
Step 3 - Associate the XML Document with your Stylesheet
Next, re-open the test.xml file and add the following just after the <?xml version="1.0"?>
declaration. If you have selected the XSLT example, add:
Step 4 - Finishing UpYou are now ready to deliver your little zoological XML data file as formatted HTML! Just copy or move the XML and stylesheet files into the same directory under your httpd DocumentRoot. Then, point your browser to http://your-server.com/path/to/test.xml and you should see your data nicely formatted in an HTML table. Congratulations, you are now well on the road to adding XML, XSLT, XPathScript and AxKit to your developmental toolbelt. For more information about AxKit's advanced features, please visit the AxKit homepage. If Things Go WrongAs I stated in the introduction, this is document is designed to walk someone through the AxKit instalation process, on to serving transformed documents as quickly and simply as possible. Depending upon your setup, installing AxKit may require some special attention to get it to sanely co-exist with some of the other tools that you may be using. If you've had any trouble while following the steps outlined here, please consult the AxKit FAQ, and the AxKit User's mailing list archives.
|
||||||||||||||||||||||||||||||||