NAME

XML::Template::Element::Iterator - XML::Template module that implements abstract iteration.

SYNOPSIS

This module provides the foreach element and the underlying methods necessary for iteration. Iteration is an abstract process and is defined by the modules that are derived from this one. They simply need to provide several methods for iterating through the data type specific to the subclass.

CONSTRUCTOR

XML::Template::Element::Block inherits its constructor method, new, from XML::Template::Element.

PRIVATE METHODS

_foreach

This method implements iteration using the following algorithm:

Initialize loop
$__value = first element
While $__value is defined
  Set look variable
  $__value = next element
Finish loop

Each step is implemented by code returned by the following iteration methods, which are defined in the subclass.

ITERATOR METHODS

loopinit

This method returns Perl code that initializes the loop.

get_first

This method returns Perl code that gets the first element in the loop.

set_loopvar

This method returns Perl code that sets the loop variable that contains the value of the current element in the loop.

get_next

This method returns Perl code that gets the next element in the loop.

loopfinish

This method returns Perl code that ends the loop and performs any relevant cleaning up.

ITERATOR TAGSET METHODS

foreach

This method implements the foreach element that is inherited by a subclass which defines the internals.

AUTHOR

Jonathan Waxman <jowaxman@bbl.med.upenn.edu>

COPYRIGHT

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.