Skip to content

Commit

Permalink
Implement XPath 2 upper-case() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
wilx committed Feb 3, 2016
1 parent 93a1c87 commit cb7abf6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/XML/XPathEngine/Function.pm
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,21 @@ sub lower_case {
return XML::XPathEngine::Literal->new($str);
}

sub upper_case {
my $self = shift;
my ($node, @params) = @_;
die "lower-case: Wrong number of params\n" if @params > 1;
my $str;
if (@params) {
$str = $params[0]->string_value;
}
else {
$str = $node->string_value;
}
$str = uc $str;
return XML::XPathEngine::Literal->new($str);
}

sub translate {
my $self = shift;
my ($node, @params) = @_;
Expand Down

0 comments on commit cb7abf6

Please sign in to comment.