This tutorial provides an overview on how to create Aranea modules.
An Aranea module is a Perl module that provides one procedure,
doModule
, whose only argument is an Aranea XML object and
returns an Aranea XML object. In addition, each Aranea module has the
ability to run stand-alone from the command-line, in which case it
expects the Aranea XML object from STDIN and prints the XML to STDOUT.
Here is the skeleton of an Aranea module:
|
The following fragment is responsible for handling the behavior of the
module if it is called from the command line. After reading from
STDIN, an Aranea XML object is created and then passed to
doModule
, which performs the work. After that procedure
returns, the Aranea XML object is converted back into XML output on
STDOUT.
|
The following fragment shows exactly what the doModule
procedure
should look like:
|
The only argument to the procedure is the Aranea XML object, which it returns at the end. Typically, each module also inserts an ID (the CVS keyword dollarsignIDdollarsign), so that the Aranea XML object can keep track of the sequence of modules that was executed.