[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 # $Id: Variable.pm,v 1.5 2001/03/16 11:10:08 matt Exp $ 2 3 package XML::XPath::Variable; 4 use strict; 5 6 # This class does NOT contain 1 instance of a variable 7 # see the XML::XPath::Parser class for the instances 8 # This class simply holds the name of the var 9 10 sub new { 11 my $class = shift; 12 my ($pp, $name) = @_; 13 bless { name => $name, path_parser => $pp }, $class; 14 } 15 16 sub as_string { 17 my $self = shift; 18 '\$' . $self->{name}; 19 } 20 21 sub as_xml { 22 my $self = shift; 23 return "<Variable>" . $self->{name} . "</Variable>\n"; 24 } 25 26 sub get_value { 27 my $self = shift; 28 $self->{path_parser}->get_var($self->{name}); 29 } 30 31 sub set_value { 32 my $self = shift; 33 my ($val) = @_; 34 $self->{path_parser}->set_var($self->{name}, $val); 35 } 36 37 sub evaluate { 38 my $self = shift; 39 my $val = $self->get_value; 40 return $val; 41 } 42 43 1;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |