SummaryAs I've demonstrated in this chapter, XML can be easily integrated with database-driven applications and represent relational data. The inherent hierarchy of XML fits in very well with the relational database model. In addition, because XML is plain text, it can easily be transferred between two applications on different platforms (for example, Microsoft Windows and Linux) written in different languages (for example, Perl and Java). This chapter illustrates the power of XML ”it is platform and language independent and can easily be used as the common middleware format when converting or working with two or more foreign data types. |
Exercises
For suggested solutions to this exercise, be sure to check out the web site: http://www.xmlproj.com/book/chapter6. |
Relevant LinksPerl DBI Home Page: http://dbi.perl.org. XML and Database Links: http://www.rpbourret.com/xml/XMLDBLinks.htm. XML DBMS Middleware: http://www.rpbourret.com/xmldbms/. |
Chapter 7. Transforming Miscellaneous Data Formats to XML (and Vice-Versa)
|
Chapter Roadmap
This chapter discusses generating XML documents from various input data formats. The concept seems to be pretty simple; however, there is more to it than you might think. I'll also
Here is a quick summary of the topics discussed in this chapter.
To run the examples in this chapter, you will need to install the following Perl modules:
Note
If you have any questions about Perl modules (for example, where do you get them, how do you install them, and so forth),
|
Why Convert Another Data Format to XML?
XML is everywhere.You see it online, read about it in
Now, you might ask, how does that apply to this chapter? XML is powerful and there are
Another format that is commonly used and distributed among users on Microsoft Windows platforms is the binary Microsoft Excel format. Microsoft Excel is a spreadsheet application that supports data input, manipulation, and storage. This being the case, many applications enable their users to enter their data in Excel and then upload it into the system by accepting the binary Microsoft Excel files as input.
Because these types of problems exist, there are Perl modules designed to help you solve them. Remember, someone has probably already run into the problem you're having. SAXDriver modules are designed to facilitate converting other data formats into XML by giving you the flexibility of providing your own conversion rules and by being very efficient and light-weight (that is, small memory footprint). These are important qualities that would enable you to deploy these applications in a critical production environment and deal with large XML documents. Imagine the
|