XML::Template::Config - Configuration module for XML::Template modules.
use base qw(XML::Template::Base); use XML::Template::Base;
This module is the XML::Template configuration module. It contains the default values of many configuration variables used by many XML::Template modules.
Configuration variables and their default values are defined at the top of XML/Template/Config.pm. The variable name must be all uppercase. Variable values are actually anonymous array tuples. The first element is the type of configuration variable (VAR or PACKAGE), and the second element is the value. For instance,
XML/Template/Config.pm
VAR
PACKAGE
$CONFIGFILE = [VAR, '/usr/local/xml-template/xml-template.conf']; $PROCESS = [PACKAGE, 'XML::Template::Process'];
A configuration variable value is obtained by a calls to an XML::Template::Config subroutine that has the same name as the configuration variable but is lowercase. For instance, to get the values of the configuration variables above,
my $configfile = XML::Template::Config->configfile; my $process = XML::Template::Config->process (%params);
For configuration variables of the type VAR, the value is simply returned. If the type is PACKAGE, the module given by the configuration variable value is required, and an object is instantiated and returned. Parameters passed to the XML::Template::Config subroutine are passed to the module constructor.
The base installation directory for XML::Template. This directory typically contains the system-wide configuration file, a directory containing the siteadmin templates, and other system-wide templates.
The directory containing the siteadmin templates, typically $BASEDIR/admin.
$BASEDIR/admin
The directory containing the system-wide configuration file, typically $BASEDIR.
$BASEDIR
The name of the system-wide configuration file, typically xml-template.conf.
xml-template.conf
The default name of the host if none is given.
XML::Template
The default document processing module, typically XML::Template::Process.
The name of default the SAX parser handler module, typically XML::Template::Parser.
The name of the default module that contains methods implementing XML::Template subroutines, typically XML::Template::Subroutine.
The default document memory caching module, typically XML::Template::Cache.
The default document file caching module, typically XML::Cache::File.
The default module that implements XML::Template variables, typically XML::Template::Vars.
The size of the cache array.
The directory where cached template document files are stored, typically /tmp/xml-template.
/tmp/xml-template
The default module that parses XML::Template strings (attribute values and content).
my $config = XML::Template::Config->config ($configfile);
This method reference a reference to an XML parser object (currently a GDOME object) for the parsed XML::Template XML cofiguration document. The first call to config loads the config file and stores it in the package global variable $CONFIG. Subsequent calls to config will simply return $CONFIG.
config
$CONFIG
An optional parameter may be given naming the config file. If no parameter is given, the system-wide configuration file is named by the configuration variable $CONFIGFILE and is located in the directory specified by $CONFIGDIR.
$CONFIGFILE
$CONFIGDIR
If the element basedir is present in the host configuration for the current host, a host-specific configuration document is loaded from basedir and its contents appended to the contents of the system-wide configuration.
basedir
XML::Template::Config->load ($module) || return $self->error (XML::Template::Config->error);
This method requires the module named by the parameter.
Jonathan Waxman <jowaxman@bbl.med.upenn.edu>
Copyright (c) 2002-2003 Jonathan A. Waxman All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install XML::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Template
CPAN shell
perl -MCPAN -e shell install XML::Template
For more information on module installation, please visit the detailed CPAN module installation guide.