XML::Template - Front end module to XML::Template.
use XML::Template; my $xml_template = XML::Template->new ($config) || die XML::Template->error; $xml_template->process ('filename.xhtml', %vars) || die $xml_template->error;
This module provides a front-end interface to XML::Template.
A constructor method new is provided by XML::Template::Base. A list of named configuration parameters may be passed to the constructor. The constructor returns a reference to a new XML::Template object or undef if an error occurrs. If undef is returned, use the method error to retrieve the error. For instance:
new
error
my $xml_template = XML::Template->new (%config) || die XML::Template->error;
The following named configuration parameters are supported by this module:
Reference to a processor object. The default process object is XML::Template::Process.
See XML::Template::Base for general options.
This method is the internal initialization function called from XML::Template::Base when a new object is created.
$xml_template->process ($filename, %vars) || die $xml_template->error;
This method is used to process an XML file. The first parameter is the name of a piece of XML. The source of the XML depends on the present process loaders. (See get_load and set_load in XML::Template::Process.) The second parameter is a reference to a hash containing name/value pairs of variables to add to the global variable context.
get_load
set_load
Much of the initial design philosophy (and design) was taken from the masterfully written Template Toolkit by Andy Wardley which I use extensively myself.
Thanks to Josh Marcus, August Wohlt, and Kristina Clair for many valuable discussions.
Jonathan A. Waxman jowaxman@bbl.med.upenn.edu
Copyright (c) 2002 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.