DBIx::XMLServer 0.02 reviewDownload
DBIx::XMLServer is a Perl module to serve data as XML in response to HTTP requests. SYNOPSIS use XML::LibXML; use DBIx::XM
DBIx::XMLServer is a Perl module to serve data as XML in response to HTTP requests.
my $xml_server = new DBIx::XMLServer($dbh, "template.xml");
my $doc = $xml_server->process($QUERY_STRING);
die "Error: $doc" unless ref $doc;
print "Content-type: application/xmlrnrn";
This module implements the whole process of generating an XML document from a database query, in response to an HTTP request. The mapping from the DBI database to an XML structure is defined in a template file, also in XML; this template is used not only to turn the data into XML, but also to parse the query string. To the user, the format of the query string is very natural in relation to the XML data which they will receive.
All the methods of this object can take a hash of named parameters instead of a list of parameters.
One DBIx::XMLServer object can process several queries. The following steps take place in processing a query:
The query string is parsed. It contains search criteria together with other options about the format of the returned data.
The search criteria from the query string are converted, using the XML template, into an SQL SELECT statement.
The results of the SQL query are translated into XML, again using the template, and returned to the caller.
DBIx::XMLServer 0.02 search tags