This chapter focuses on generating XML documents from a number of data sources. So far, you have learned how to parse and process XML, but I haven't discussed the actual source of XML data. How do you create or generate an XML document? In this chapter, I will discuss several approaches to generating XML documents. During the course of this discussion, I will present examples of programs that generate XML data from a number of sources. I'll show how to generate XML using simple print statements as well as using Perl modules. The XML::Writer Perl module is used as a primary writer module; however, the XML::Handler::YAWriter Perl module is also presented as a potential alternative to the XML::Writer Perl module. To run the examples presented in this chapter, you'll need to install the following Perl modules:
Note Remember, if you have any questions about Perl modules (for example, where do you get them, how do you install them, and so forth), please refer to Appendix B, "Perl Essentials." |