The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
[%#
  # IMPORTANT NOTE
  #   This documentation is generated automatically from source
  #   templates.  Any changes you make here may be lost.
  # 
  #   The 'docsrc' documentation source bundle is available for download
  #   from http://www.template-toolkit.org/docs.html and contains all
  #   the source templates, XML files, scripts, etc., from which the
  #   documentation for the Template Toolkit is built.
-%]
[% META book = 'Manual'
        page = 'Plugins'
%]
[%  WRAPPER toc;
	PROCESS tocitem 
	        title ="DESCRIPTION"
                subs  = [];
	PROCESS tocitem 
	        title ="TEMPLATE TOOLKIT PLUGINS"
                subs  = [
                    "Autoformat",
		    "CGI",
		    "Datafile",
		    "Date",
		    "Directory",
		    "DBI",
		    "Dumper",
		    "File",
		    "Filter",
		    "Format",
		    "GD::Image, GD::Polygon, GD::Constants",
		    "GD::Text, GD::Text::Align, GD::Text::Wrap",
		    "GD::Graph::lines, GD::Graph::bars, GD::Graph::points, GD::Graph::linespoin
ts, GD::Graph::area, GD::Graph::mixed, GD::Graph::pie",
		    "GD::Graph::bars3d, GD::Graph::lines3d, GD::Graph::pie3d",
		    "HTML",
		    "Iterator",
		    "Pod",
		    "String",
		    "Table",
		    "URL",
		    "Wrap",
		    "XML::DOM",
		    "XML::RSS",
		    "XML::Simple",
		    "XML::Style",
		    "XML::XPath"
		];
	PROCESS tocitem 
	        title ="AUTHOR"
                subs  = [];
	PROCESS tocitem 
	        title ="VERSION"
                subs  = [];
	PROCESS tocitem 
	        title ="COPYRIGHT"
                subs  = [];
    END
%]
<!-- Pod to HTML conversion by the Template Toolkit version 2 -->
[% WRAPPER section
    title="DESCRIPTION"
-%]<p>
This section lists the standard plugins which can be used to extend the
runtime functionality of the Template Toolkit. The plugins are
distributed with the Template Toolkit but may required additional
modules from CPAN.
</p>
[%- END %]
[% WRAPPER section
    title="TEMPLATE TOOLKIT PLUGINS"
-%]<p>
The following plugin modules are distributed with the Template
Toolkit.  Some of the plugins interface to external modules (detailed
below) which should be downloaded from any CPAN site and installed
before using the plugin.
</p>
[% WRAPPER subsection
   title = "Autoformat"
-%]<p>
The Autoformat plugin is an interface to Damian Conway's Text::Autoformat 
Perl module which provides advanced text wrapping and formatting.  See
[% ttlink('Template::Plugin::Autoformat') -%] and [% ttlink('Text::Autoformat') -%] for further 
details.
</p>
<pre>    [% tt_start_tag %] USE autoformat(left=10, right=20) [% tt_end_tag %]
    [% tt_start_tag %] autoformat(mytext) [% tt_end_tag %]	    # call autoformat sub
    [% tt_start_tag %] mytext FILTER autoformat [% tt_end_tag %]  # or use autoformat filter</pre>
<p>
The Text::Autoformat module is available from CPAN:
</p>
<pre>    http://www.cpan.org/modules/by-module/Text/</pre>
[%- END %]
[% WRAPPER subsection
   title = "CGI"
-%]<p>
The CGI plugin is a wrapper around Lincoln Stein's 
&lt;lstein@genome.wi.mit.edu&gt; CGI.pm module.  The plugin is 
distributed with the Template Toolkit (see [% ttlink('Template::Plugin::CGI') -%])
and the CGI module itself is distributed with recent versions Perl,
or is available from CPAN.
</p>
<pre>    [% tt_start_tag %] USE CGI [% tt_end_tag %]
    [% tt_start_tag %] CGI.param('param_name') [% tt_end_tag %]
    [% tt_start_tag %] CGI.start_form [% tt_end_tag %]
    [% tt_start_tag %] CGI.popup_menu( Name   =&gt; 'color', 
                       Values =&gt; [ 'Green', 'Brown' ] ) [% tt_end_tag %]
    [% tt_start_tag %] CGI.end_form [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "Datafile"
-%]<p>
Provides an interface to data stored in a plain text file in a simple
delimited format.  The first line in the file specifies field names
which should be delimiter by any non-word character sequence.
Subsequent lines define data using the same delimiter as int he first
line.  Blank lines and comments (lines starting '#') are ignored.  See
[% ttlink('Template::Plugin::Datafile') -%] for further details.
</p>
<p>
/tmp/mydata:
</p>
<pre>    # define names for each field
    id : email : name : tel
    # here's the data
    fred : fred@here.com : Fred Smith : 555-1234
    bill : bill@here.com : Bill White : 555-5678</pre>
<p>
example:
</p>
<pre>    [% tt_start_tag %] USE userlist = datafile('/tmp/mydata') [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FOREACH user = userlist [% tt_end_tag %]
       [% tt_start_tag %] user.name [% tt_end_tag %] ([% tt_start_tag %] user.id [% tt_end_tag %])
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "Date"
-%]<p>
The Date plugin provides an easy way to generate formatted time and date
strings by delegating to the POSIX strftime() routine.   See
[% ttlink('Template::Plugin::Date') -%] and [% ttlink('POSIX') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE date [% tt_end_tag %]
    [% tt_start_tag %] date.format [% tt_end_tag %]		# current time/date</pre>
<pre>    File last modified: [% tt_start_tag %] date.format(template.modtime) [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "Directory"
-%]<p>
The Directory plugin provides a simple interface to a directory and
the files within it.  See [% ttlink('Template::Plugin::Directory') -%] for further
details.
</p>
<pre>    [% tt_start_tag %] USE dir = Directory('/tmp') [% tt_end_tag %]
    [% tt_start_tag %] FOREACH file = dir.files [% tt_end_tag %]
        # all the plain files in the directory
    [% tt_start_tag %] END [% tt_end_tag %]
    [% tt_start_tag %] FOREACH file = dir.dirs [% tt_end_tag %]
        # all the sub-directories
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "DBI"
-%]<p>
The DBI plugin, developed by Simon Matthews
&lt;sam@knowledgepool.com&gt;, brings the full power of Tim Bunce's
&lt;Tim.Bunce@ig.co.uk&gt; database interface module (DBI) to your
templates.  See [% ttlink('Template::Plugin::DBI') -%] and [% ttlink('DBI') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE DBI('dbi:driver:database', 'user', 'pass') [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FOREACH user = DBI.query( 'SELECT * FROM users' ) [% tt_end_tag %]
       [% tt_start_tag %] user.id [% tt_end_tag %] [% tt_start_tag %] user.name [% tt_end_tag %]
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
The DBI and relevant DBD modules are available from CPAN:
</p>
<pre>  http://www.cpan.org/modules/by-module/DBI/</pre>
[%- END %]
[% WRAPPER subsection
   title = "Dumper"
-%]<p>
The Dumper plugin provides an interface to the Data::Dumper module.  See
[% ttlink('Template::Plugin::Dumper') -%] and [% ttlink('Data::Dumper') -%] for futher details.
</p>
<pre>    [% tt_start_tag %] USE dumper(indent=0, pad=&quot;&lt;br&gt;&quot;) [% tt_end_tag %]
    [% tt_start_tag %] dumper.dump(myvar, yourvar) [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "File"
-%]<p>
The File plugin provides a general abstraction for files and can be
used to fetch information about specific files within a filesystem.
See [% ttlink('Template::Plugin::File') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE File('/tmp/foo.html') [% tt_end_tag %]
    [% tt_start_tag %] File.name [% tt_end_tag %]     # foo.html
    [% tt_start_tag %] File.dir [% tt_end_tag %]      # /tmp
    [% tt_start_tag %] File.mtime [% tt_end_tag %]    # modification time</pre>
[%- END %]
[% WRAPPER subsection
   title = "Filter"
-%]<p>
This module implements a base class plugin which can be subclassed
to easily create your own modules that define and install new filters.
</p>
<pre>    package MyOrg::Template::Plugin::MyFilter;</pre>
<pre>    use Template::Plugin::Filter;
    use base qw( Template::Plugin::Filter );</pre>
<pre>    sub filter {
	my ($self, $text) = @_;</pre>
<pre>	# ...mungify $text...</pre>
<pre>	return $text;
    }</pre>
<pre>    # now load it...
    [% tt_start_tag %] USE MyFilter [% tt_end_tag %]</pre>
<pre>    # ...and use the returned object as a filter
    [% tt_start_tag %] FILTER $MyFilter [% tt_end_tag %]
      ...
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
See [% ttlink('Template::Plugin::Filter') -%] for further details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "Format"
-%]<p>
The Format plugin provides a simple way to format text according to a
printf()-like format.   See [% ttlink('Template::Plugin::Format') -%] for further 
details.
</p>
<pre>    [% tt_start_tag %] USE bold = format('&lt;b&gt;%s&lt;/b&gt;') [% tt_end_tag %]
    [% tt_start_tag %] bold('Hello') [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "GD::Image, GD::Polygon, GD::Constants"
-%]<p>
These plugins provide access to the GD graphics library via Lincoln
D. Stein's GD.pm interface.  These plugins allow PNG, JPEG and other
graphical formats to be generated.
</p>
<pre>    [% tt_start_tag %] FILTER null;
        USE im = GD.Image(100,100);
        # allocate some colors
        black = im.colorAllocate(0,   0, 0);
        red   = im.colorAllocate(255,0,  0);
        blue  = im.colorAllocate(0,  0,  255);
        # Draw a blue oval
        im.arc(50,50,95,75,0,360,blue);
        # And fill it with red
        im.fill(50,50,red);
        # Output image in PNG format
        im.png | stdout(1);
       END;
    -[% tt_end_tag %]</pre>
<p>
See [% ttlink('Template::Plugin::GD::Image') -%] for further details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "GD::Text, GD::Text::Align, GD::Text::Wrap"
-%]<p>
These plugins provide access to Martien Verbruggen's GD::Text,
GD::Text::Align and GD::Text::Wrap modules. These plugins allow the
layout, alignment and wrapping of text when drawing text in GD images.
</p>
<pre>    [% tt_start_tag %] FILTER null;
        USE gd  = GD.Image(200,400);
        USE gdc = GD.Constants;
        black = gd.colorAllocate(0,   0, 0);
        green = gd.colorAllocate(0, 255, 0);
        txt = &quot;This is some long text. &quot; | repeat(10);
        USE wrapbox = GD.Text.Wrap(gd,
         line_space  =&gt; 4,
         color       =&gt; green,
         text        =&gt; txt,
        );
        wrapbox.set_font(gdc.gdMediumBoldFont);
        wrapbox.set(align =&gt; 'center', width =&gt; 160);
        wrapbox.draw(20, 20);
        gd.png | stdout(1);
      END;
    -[% tt_end_tag %]</pre>
<p>
See [% ttlink('Template::Plugin::GD::Text') -%], [% ttlink('Template::Plugin::GD::Text::Align') -%]
and [% ttlink('Template::Plugin::GD::Text::Wrap') -%] for further details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "GD::Graph::lines, GD::Graph::bars, GD::Graph::points, GD::Graph::linespoin
ts, GD::Graph::area, GD::Graph::mixed, GD::Graph::pie"
-%]<p>
These plugins provide access to Martien Verbruggen's GD::Graph module
that allows graphs, plots and charts to be created. These plugins allow
graphs, plots and charts to be generated in PNG, JPEG and other
graphical formats.
</p>
<pre>    [% tt_start_tag %] FILTER null;
        data = [
            [&quot;1st&quot;,&quot;2nd&quot;,&quot;3rd&quot;,&quot;4th&quot;,&quot;5th&quot;,&quot;6th&quot;],
            [    4,    2,    3,    4,    3,  3.5]
        ];
        USE my_graph = GD.Graph.pie(250, 200);
        my_graph.set(
                title =&gt; 'A Pie Chart',
                label =&gt; 'Label',
                axislabelclr =&gt; 'black',
                pie_height =&gt; 36,
                transparent =&gt; 0,
        );
        my_graph.plot(data).png | stdout(1);
      END;
    -[% tt_end_tag %]</pre>
<p>
See
[% ttlink('Template::Plugin::GD::Graph::lines') -%],
[% ttlink('Template::Plugin::GD::Graph::bars') -%],
[% ttlink('Template::Plugin::GD::Graph::points') -%],
[% ttlink('Template::Plugin::GD::Graph::linespoints') -%],
[% ttlink('Template::Plugin::GD::Graph::area') -%],
[% ttlink('Template::Plugin::GD::Graph::mixed') -%],
[% ttlink('Template::Plugin::GD::Graph::pie') -%], and
[% ttlink('GD::Graph') -%],
for more details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "GD::Graph::bars3d, GD::Graph::lines3d, GD::Graph::pie3d"
-%]<p>
These plugins provide access to Jeremy Wadsack's GD::Graph3d
module.  This allows 3D bar charts and 3D lines plots to
be generated.
</p>
<pre>    [% tt_start_tag %] FILTER null;
        data = [
            [&quot;1st&quot;,&quot;2nd&quot;,&quot;3rd&quot;,&quot;4th&quot;,&quot;5th&quot;,&quot;6th&quot;,&quot;7th&quot;, &quot;8th&quot;, &quot;9th&quot;],
            [    1,    2,    5,    6,    3,  1.5,    1,     3,     4],
        ];
        USE my_graph = GD.Graph.bars3d();
        my_graph.set(
            x_label         =&gt; 'X Label',
            y_label         =&gt; 'Y label',
            title           =&gt; 'A 3d Bar Chart',
            y_max_value     =&gt; 8,
            y_tick_number   =&gt; 8,
            y_label_skip    =&gt; 2,
            # shadows
            bar_spacing     =&gt; 8,
            shadow_depth    =&gt; 4,
            shadowclr       =&gt; 'dred',
            transparent     =&gt; 0,
        my_graph.plot(data).png | stdout(1);
      END;
    -[% tt_end_tag %]</pre>
<p>
See
[% ttlink('Template::Plugin::GD::Graph::lines3d') -%],
[% ttlink('Template::Plugin::GD::Graph::bars3d') -%], and
[% ttlink('Template::Plugin::GD::Graph::pie3d') -%]
for more details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "HTML"
-%]<p>
The HTML plugin is very new and very basic, implementing a few useful
methods for generating HTML.  It is likely to be extended in the future
or integrated with a larger project to generate HTML elements in a generic
way (as discussed recently on the mod_perl mailing list).
</p>
<pre>    [% tt_start_tag %] USE HTML [% tt_end_tag %]
    [% tt_start_tag %] HTML.escape(&quot;if (a &lt; b &amp;&amp; c &gt; d) ...&quot; [% tt_end_tag %]
    [% tt_start_tag %] HTML.attributes(border =&gt; 1, cellpadding =&gt; 2) [% tt_end_tag %]
    [% tt_start_tag %] HTML.element(table =&gt; { border =&gt; 1, cellpadding =&gt; 2 }) [% tt_end_tag %]</pre>
<p>
See [% ttlink('Template::Plugin::Iterator') -%] for further details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "Iterator"
-%]<p>
The Iterator plugin provides a way to create a Template::Iterator
object to iterate over a data set.  An iterator is created
automatically by the FOREACH directive and is aliased to the 'loop'
variable.  This plugin allows an iterator to be explicitly created
with a given name, or the default plugin name, 'iterator'.  See
[% ttlink('Template::Plugin::Iterator') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE iterator(list, args) [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FOREACH item = iterator [% tt_end_tag %]
       [% tt_start_tag %] '&lt;ul&gt;' IF iterator.first [% tt_end_tag %]
       &lt;li&gt;[% tt_start_tag %] item [% tt_end_tag %]
       [% tt_start_tag %] '&lt;/ul&gt;' IF iterator.last [% tt_end_tag %]
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "Pod"
-%]<p>
This plugin provides an interface to the [% ttlink('Pod::POD', 'Pod::POD') -%] module
which parses POD documents into an internal object model which can
then be traversed and presented through the Template Toolkit.
</p>
<pre>    [% tt_start_tag %] USE Pod(podfile) [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FOREACH head1 = Pod.head1;
	 FOREACH head2 = head1/head2;
	   ...
         END;
       END
    [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "String"
-%]<p>
The String plugin implements an object-oriented interface for 
manipulating strings.  See [% ttlink('Template::Plugin::String') -%] for further 
details.
</p>
<pre>    [% tt_start_tag %] USE String 'Hello' [% tt_end_tag %]
    [% tt_start_tag %] String.append(' World') [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] msg = String.new('Another string') [% tt_end_tag %]
    [% tt_start_tag %] msg.replace('string', 'text') [% tt_end_tag %]</pre>
<pre>    The string &quot;[% tt_start_tag %] msg [% tt_end_tag %]&quot; is [% tt_start_tag %] msg.length [% tt_end_tag %] characters long.</pre>
[%- END %]
[% WRAPPER subsection
   title = "Table"
-%]<p>
The Table plugin allows you to format a list of data items into a 
virtual table by specifying a fixed number of rows or columns, with 
an optional overlap.  See [% ttlink('Template::Plugin::Table') -%] for further 
details.
</p>
<pre>    [% tt_start_tag %] USE table(list, rows=10, overlap=1) [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FOREACH item = table.col(3) [% tt_end_tag %]
       [% tt_start_tag %] item [% tt_end_tag %]
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
[%- END %]
[% WRAPPER subsection
   title = "URL"
-%]<p>
The URL plugin provides a simple way of contructing URLs from a base
part and a variable set of parameters.  See [% ttlink('Template::Plugin::URL') -%]
for further details.
</p>
<pre>    [% tt_start_tag %] USE mycgi = url('/cgi-bin/bar.pl', debug=1) [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] mycgi [% tt_end_tag %]
       # ==&gt; /cgi/bin/bar.pl?debug=1</pre>
<pre>    [% tt_start_tag %] mycgi(mode='submit') [% tt_end_tag %]
       # ==&gt; /cgi/bin/bar.pl?mode=submit&amp;debug=1</pre>
[%- END %]
[% WRAPPER subsection
   title = "Wrap"
-%]<p>
The Wrap plugin uses the Text::Wrap module by David Muir Sharnoff 
&lt;muir@idiom.com&gt; (with help from Tim Pierce and many many others)
to provide simple paragraph formatting.  See [% ttlink('Template::Plugin::Wrap') -%]
and [% ttlink('Text::Wrap') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE wrap [% tt_end_tag %]
    [% tt_start_tag %] wrap(mytext, 40, '* ', '  ') [% tt_end_tag %]	# use wrap sub
    [% tt_start_tag %] mytext FILTER wrap(40) -[% tt_end_tag %]	# or wrap FILTER</pre>
<p>
The Text::Wrap module is available from CPAN:
</p>
<pre>    http://www.cpan.org/modules/by-module/Text/</pre>
[%- END %]
[% WRAPPER subsection
   title = "XML::DOM"
-%]<p>
The XML::DOM plugin gives access to the XML Document Object Module via
Clark Cooper &lt;cooper@sch.ge.com&gt; and Enno Derksen's 
&lt;enno@att.com&gt; XML::DOM module.  See [% ttlink('Template::Plugin::XML::DOM') -%] 
and [% ttlink('XML::DOM') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE dom = XML.DOM [% tt_end_tag %]
    [% tt_start_tag %] doc = dom.parse(filename) [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FOREACH node = doc.getElementsByTagName('CODEBASE') [% tt_end_tag %]
       * [% tt_start_tag %] node.getAttribute('href') [% tt_end_tag %]
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
The plugin requires the XML::DOM module, available from CPAN:
</p>
<pre>    http://www.cpan.org/modules/by-module/XML/</pre>
[%- END %]
[% WRAPPER subsection
   title = "XML::RSS"
-%]<p>
The XML::RSS plugin is a simple interface to Jonathan Eisenzopf's
&lt;eisen@pobox.com&gt; XML::RSS module.  A RSS (Rich Site Summary)
file is typically used to store short news 'headlines' describing
different links within a site.  This plugin allows you to parse RSS
files and format the contents accordingly using templates.  
See [% ttlink('Template::Plugin::XML::RSS') -%] and [% ttlink('XML::RSS') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE news = XML.RSS(filename) [% tt_end_tag %]
   
    [% tt_start_tag %] FOREACH item = news.items [% tt_end_tag %]
       &lt;a href=&quot;[% tt_start_tag %] item.link [% tt_end_tag %]&quot;&gt;[% tt_start_tag %] item.title [% tt_end_tag %]&lt;/a&gt;
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
The XML::RSS module is available from CPAN:
</p>
<pre>    http://www.cpan.org/modules/by-module/XML/</pre>
[%- END %]
[% WRAPPER subsection
   title = "XML::Simple"
-%]<p>
This plugin implements an interface to the [% ttlink('XML::Simple', 'XML::Simple') -%]
module.
</p>
<pre>    [% tt_start_tag %] USE xml = XML.Simple(xml_file_or_text) [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] xml.head.title [% tt_end_tag %]</pre>
<p>
See [% ttlink('Template::Plugin::XML::Simple') -%] for further details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "XML::Style"
-%]<p>
This plugin defines a filter for performing simple stylesheet based 
transformations of XML text.  
</p>
<pre>    [% tt_start_tag %] USE xmlstyle 
           table = { 
               attributes = { 
                   border      = 0
                   cellpadding = 4
                   cellspacing = 1
               }
           }
    [% tt_end_tag %]</pre>
<pre>    [% tt_start_tag %] FILTER xmlstyle [% tt_end_tag %]
    &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;Foo&lt;/td&gt; &lt;td&gt;Bar&lt;/td&gt; &lt;td&gt;Baz&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
See [% ttlink('Template::Plugin::XML::Style') -%] for further details.
</p>
[%- END %]
[% WRAPPER subsection
   title = "XML::XPath"
-%]<p>
The XML::XPath plugin provides an interface to Matt Sergeant's
&lt;matt@sergeant.org&gt; XML::XPath module.  See 
[% ttlink('Template::Plugin::XML::XPath') -%] and [% ttlink('XML::XPath') -%] for further details.
</p>
<pre>    [% tt_start_tag %] USE xpath = XML.XPath(xmlfile) [% tt_end_tag %]
    [% tt_start_tag %] FOREACH page = xpath.findnodes('/html/body/page') [% tt_end_tag %]
       [% tt_start_tag %] page.getAttribute('title') [% tt_end_tag %]
    [% tt_start_tag %] END [% tt_end_tag %]</pre>
<p>
The plugin requires the XML::XPath module, available from CPAN:
</p>
<pre>    http://www.cpan.org/modules/by-module/XML/</pre>
[%- END %]
[%- END %]
[% WRAPPER section
    title="AUTHOR"
-%]<p>
Andy Wardley &lt;abw@andywardley.com&gt;
</p>
<p>
[% ttlink('http://www.andywardley.com/', 'http://www.andywardley.com/') -%]
</p>
[%- END %]
[% WRAPPER section
    title="VERSION"
-%]<p>
Template Toolkit version 2.08, released on 30 July 2002.
</p>
[%- END %]
[% WRAPPER section
    title="COPYRIGHT"
-%]<pre>  Copyright (C) 1996-2002 Andy Wardley.  All Rights Reserved.
  Copyright (C) 1998-2002 Canon Research Centre Europe Ltd.</pre>
<p>
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
</p>
[%- END %]