NAME
XML::Template - Front end module to XML::Template.
SYNOPSIS
use XML::Template;
my $xml_template = XML::Template->new ($config)
|| die XML::Template->error;
$xml_template->process ('filename.xhtml', %vars)
|| die $xml_template->error;
DESCRIPTION
This module provides a front-end interface to XML::Template.
CONSTRUCTOR
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:
my $xml_template = XML::Template->new (%config)
|| die XML::Template->error;
The following named configuration parameters are supported by this module:
- Process
-
Reference to a processor object. The default process object is XML::Template::Process.
See XML::Template::Base for general options.
PRIVATE METHODS
_init
This method is the internal initialization function called from XML::Template::Base when a new object is created.
PUBLIC METHODS
process
$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.
ACKNOWLEDGEMENTS
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.
AUTHOR
Jonathan A. Waxman jowaxman@bbl.med.upenn.edu
COPYRIGHT
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.