Chapter Roadmap


This chapter discusses XML transformation and filtering. XML transformation is the process of converting an XML document into one or more output documents. These output documents can be any one of a number of different formats. Some of the possible resulting document formats include the following: XML, XHTML, HTML, WML, RTF, and CSV.

Two types of XSL-based transformations exist ”a formatting language and a transformation language. The formatting language, XML Formatting Objects (XSL-FO) is used to create text layouts for documents. As of this writing, no major browsers support XSL-FO, so most XSL-FO is converted into another format (for example, PDF or T E X) for viewing.

In this chapter, we're going to focus on the XSL Transformation (XSLT) standard that defines the transformation language. This language is a tags-based scripting language that enables you to generate output from XML data in a wide variety of text formats. An XSLT processor applies these rules to an input XML document and generates the desired output. These rules are stored in an XSLT stylesheet.

Filtering describes the process of using XSLT to generate a new XML document that is a subset of the larger XML source document. In essence, you develop a set of rules that filter out the portion(s) of the source XML document that you require.

This chapter discusses the format of transformation rules and demonstrate how to apply them. As is usually the case with Perl, there are several Perl modules that can be used to perform the transformation. I will provide an example for each of the major Perl XSLT modules and discuss the differences between each of the modules. This will assist you in making the proper decision about which module you should use for a particular task.

To run the examples presented in this chapter, you'll need to install the following Perl modules:

  • XML::LibXSLT

  • XML::Sablotron

  • XML::Xpath

Note

Remember, if you have any questions about Perl modules (for example, where do you get them, how to install them, and so forth) please refer to Appendix B, "Perl Essentials."




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