XML technologies / XML / Perl & XML / RSS, SOAP and other XML applications / XML modules

(Excerpt from "Perl & XML" by Erik T. Ray & Jason McIntosh)

By XML modules we mean Perl modules on CPAN concerned with XML. So far, this book has covered general-purpose Perl extensions suitable for any XML application, using small XML fragments without specific semantics. We concentrated on deciding what to do next. Our examples followed this pattern: an XML parser is created to generate a document; its elements and attributes are manipulated, and the result is output in some form.

This section’s modules are systems built on parsers and general processing tools. Their APIs may still expose raw XML, but primarily provide application-specific methods and functions that may hide XML entirely.

We distinguish three types of these higher-level XML modules and examine one example of each. In XML::RSS we will build examples ourselves.

Utilities for XML applications
Utilities are the small helpers supporting everyday work. Often they simply wrap raw XML processors conveniently, which may be all that is needed. If several programs read and write the same XML format, moving shared functions into a reusable helper module soon makes sense. This frees the programmer from format details, both when validating input and when producing well-formed output.

Programming tools that use XML
This small but rapidly growing niche contains Perl extensions using XML to add interesting capabilities to programs. The main examples are currently the PerlSAX2 family, which brings DBI’s excellent abstraction layer to XML::SAX. One individual module is XML::Generator::DBI, providing interfaces for database manipulation. Similar modules exist for other data sources unrelated to XML.

Complete applications built on XML
Finally, we cover software based on XML but separated from the XML format by so many abstraction layers that the format fades into the background. Calling it an XML application may be correct, but resembles calling Microsoft Word a C program. For example, working with SOAP::Lite involves documents barely readable by humans, existing only in memory until sent over HTTP; XML’s role in SOAP is completely transparent.

  

  

 

 

 

back to top