[%# # 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 = 'Modules' page = 'Plugin_XML_XPath' %] [% WRAPPER toc; INCLUDE tocitem title='SYNOPSIS'; INCLUDE tocitem title='PRE-REQUISITES'; INCLUDE tocitem title='DESCRIPTION'; INCLUDE tocitem title='AUTHORS'; INCLUDE tocitem title='VERSION'; INCLUDE tocitem title='COPYRIGHT'; INCLUDE tocitem title='SEE ALSO'; END %] [% WRAPPER section title='SYNOPSIS' -%]
# load plugin and specify XML file to parse [% tt_start_tag %] USE xpath = XML.XPath(xmlfile) [% tt_end_tag %] [% tt_start_tag %] USE xpath = XML.XPath(file => xmlfile) [% tt_end_tag %] [% tt_start_tag %] USE xpath = XML.XPath(filename => xmlfile) [% tt_end_tag %]
# load plugin and specify XML text to parse [% tt_start_tag %] USE xpath = XML.XPath(xmltext) [% tt_end_tag %] [% tt_start_tag %] USE xpath = XML.XPath(xml => xmltext) [% tt_end_tag %] [% tt_start_tag %] USE xpath = XML.XPath(text => xmltext) [% tt_end_tag %]
# then call any XPath methods (see XML::XPath docs) [% 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 %][%- END %] [% WRAPPER section title='PRE-REQUISITES' -%]
This plugin requires that the XML::Parser and XML::XPath modules be installed. These are available from CPAN:
http://www.cpan.org/modules/by-module/XML[%- END %] [% WRAPPER section title='DESCRIPTION' -%]
This is a Template Toolkit plugin interfacing to the XML::XPath module.
[%- END %] [% WRAPPER section title='AUTHORS' -%]This plugin module was written by Andy Wardley <abw@kfs.org>.
The XML::XPath module is by Matt Sergeant <matt@sergeant.org>.
[%- END %] [% WRAPPER section title='VERSION' -%]Template Toolkit version 2.01, released on 30th March 2001.
[%- END %] [% WRAPPER section title='COPYRIGHT' -%]Copyright (C) 1996-2001 Andy Wardley. All Rights Reserved. Copyright (C) 1998-2001 Canon Research Centre Europe Ltd.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
[%- END %] [% WRAPPER section title='SEE ALSO' -%][% ttlink('Template::Plugin', 'Template::Plugin') -%], [% ttlink('XML::XPath', 'XML::XPath') -%], [% ttlink('XML::Parser', 'XML::Parser') -%]
[%- END %]