NAME

XML::EP - A framework for embedding XML into a web server

SYNOPSIS

# Generate a new XML::EP instance
use XML::EP();
my $ep = XML::EP->new();

# Let the instance process an HTTP request
$ep->handle($request);

DESCRIPTION

XML::EP is an administrative framework for embedding XML into a web server. That means that the system allows you to retrieve XML documents from external storage (files, a Tamino database engine, or whatever), parse them, pipe the parsed XML tree into processors (modules, that change the tree, for example the DBI processor will issue SQL queries and insert the result as XML elements). Finally the XML tree will be piped into a so-called formatter, that converts XML to HTML and prints the result.

The architecture is as follows:

		+---------------------+
		|   Control element   |
		+---------------------+
               /          |            \
              /           |             \
   +----------+ XML  +------------+ XML  +-----------+
   | Producer | ---> | Processors | ---> | Formatter |
   +----------+      +------------+      +-----------+

The control element, an instance of XML::EP::Control, will be created first. Its purpose is the creation of the other elements, the producer (an instance of XML::EP::Producer), one or more processors (instances of XML::EP::Processor) and finally a formatter (an instance of XML::EP::Formatter). The producer, processors, formatters are selected based on virtual host, location (file part of the URL being requested) and in particular depending on the client. For example, an HTML formatter will be selected, if the client seems to request HTML, WML formatter will be created, if the client appears to be WAP HANDY and so on.

METHOD INTERFACE

Public available methods are:

Creating a control element

my $control = $ep->control();

(Instance method) This method will create an instance of XML::EP::Control. The main task of this instance is its CreatePipe method, which will then be called for creating an XML tree, a list of processors and a formatter.

Getting or setting the processors, formatters

my $processors = $self->Processors();
$self->Processors($processors);
my $formatter = $self->Formatter();
$self->Formatter($formatter);
my $request = $self->Request();
$self->Request($request);
my $response = $self->Response();
$self->Response($response);

(Instance methods) These methods are used for querying or modifying the list of processors (an array ref) or the formatter. Processors are explicitly permitted to use this methods.

The response object is designed for receiving HTTP headers, cookies, etc. that are being sent to the client. Response objects are instances of XML::EP::Response.

Handling an HTTP request

$self->Handle($request);

(Instance method) This method is called with an request object (an instance of XML::EP::Request) as argument. The request object contains all information about the client and its request, in particular HTTP headers, etc.

The method implements the HTTP requests full life cycle: A control object is created (an instance of XML::EP::Control), the control objects CreatePipe method is called for creating an XML tree and initializing the processor list and the formatter, the processors are called and finally the formatter which has to send data to the client.