#!/usr/bin/perl -w use lib '/usr/local/apache/cgi-bin/PXSQL'; use strict; use CGI qw(:standard); use PXSQL::XSQL; use PXSQL::XCGI; use XML::Sablotron qw( :all ); use DBI; use DBD::Pg; use PXSQL::EXSQL::ARTICLE; # Set the base directory for all XSQL and XSL templates. This path will # be prepend to aliases xml files my $XSQL_ROOT_DIR = '/usr/local/apache/cgi-bin/PXSQL/examples'; my $XSLT_ROOT_DIR = '/usr/local/apache/cgi-bin/PXSQL/examples'; # File containing the definition of the template files # and alias / CGI parameters association my $ALIAS_FILE = './template.lst'; my $ALIAS_CGI = './cgi_param.lst'; # Default template to use if not set my $DEFAULT_TEMPLATE = 'index'; # Do not bufferize $| = 1; my $cgi = new CGI; # Set the default template to process my $template = $cgi->param('template') || $DEFAULT_TEMPLATE; # Load all aliases between XSL templates files ans XML/SQL files # This return a hash of array as follow: # 'alias_name' => (xsl_file, xml_sql_file) my %aliases = &PXSQL::XSQL::load_templates($ALIAS_FILE); # Display an error message when a template doesn't exists if ( !exists $aliases{$template} ) { print $cgi->header(-type=>'text/html', -status => '404 Not Found'), $cgi->start_html(-title=>'404 Not Found'), qq{