XML::Template::Element::Condition - XML::Template plugin module for the condition namespace tagset.
This XML::Template plugin module implements the condition namespace tagset. The condition namespace includes tags for creating flow control structures.
XML::Template::Element::Block inherits its constructor method, new, from XML::Template::Element.
new
This method implements the beginning of an if flow control structure. The following attributes are used:
The test to perform that, if evaluates to true, passes control to the content of the if element.
This method implements the elseif section of an if flow control structure. The following attributes are used:
The test to perform that, if evaluates to true, passes control to the content of the elseif element.
This method implements the else section of an if flow control structure.
This method implements the beginning of a switch flow control structure. The following attributes are used:
The expression to compare to the value attribute of each nested case element. When a match is found, the content of that case element is evaluated.
This method implements the case section of a switch flow control structure. The following attributes are used:
If this value match the switch expression, the content of this case element will be evaluated.
sub case { my $self = shift; my ($code, $attribs) = @_;
my $value = $self->get_attrib ($attribs, 'value');
# my $cond; # if ($value =~ /^\/.*\/$/) { # $cond = "\$expr =~ $value"; # } else { my $cond = "\$__expr eq '$value'"; # }
my $outcode = qq! $cond && do { $code last SWITCH; }; !; return $outcode; }
This method implements the default section of a switch control structure. The content is evaluates when no case values match the switch expression.
Jonathan Waxman <jowaxman@bbl.med.upenn.edu>
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.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
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.