| 1 | # $Id: /tree-xpathengine/trunk/lib/Tree/XPathEngine/Root.pm 17 2006-02-12T08:00:01.814064Z mrodrigu $ | ||||||||||
| 2 | |||||||||||
| 3 | package Tree::XPathEngine::Root; | ||||||||||
| 4 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use Tree::XPathEngine::NodeSet; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 87 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 8 | 87 | my $class = shift; | |||||||||
| 9 | 87 | my $self; # actually don't need anything here - just a placeholder | |||||||||
| 10 | 87 | bless \$self, $class; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: not called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 14 | # do nothing | ||||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub as_xml { | ||||||||
|
Subroutine
as_xml: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 0 | return "<Root/>\n"; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 105 | ▶ | sub evaluate { | ||||||||
|
Subroutine
evaluate: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||
| 22 | 105 | my $self = shift; | |||||||||
| 23 | 105 | my $nodeset = shift; | |||||||||
| 24 | |||||||||||
| 25 | # warn "Eval ROOT\n"; | ||||||||||
| 26 | |||||||||||
| 27 | # must only ever occur on 1 node | ||||||||||
| 28 | 105 | ▶ | die "Can't go to root on > 1 node!" unless $nodeset->size == 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 105 | my $newset = Tree::XPathEngine::NodeSet->new(); | |||||||||
| 31 | 105 | $newset->push($nodeset->get_node(1)->xpath_get_root_node()); | |||||||||
| 32 | 105 | return $newset; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 6 | 1; | |||||||||
| 36 | __END__ | ||||||||||