<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># $Id: Root.pm,v 1.6 2001/03/16 11:10:08 matt Exp $

package XML::XPathEngine::Root;
use strict;
use XML::XPathEngine::NodeSet;

sub new {
	my $class = shift;
	my $self; # actually don't need anything here - just a placeholder
	bless \$self, $class;
}

sub as_string {
	# do nothing
}

sub as_xml {
    return "&lt;Root/&gt;\n";
}

sub evaluate {
	my $self = shift;
	my $nodeset = shift;
	
#	warn "Eval ROOT\n";
	
	# must only ever occur on 1 node
	die "Can't go to root on &gt; 1 node!" unless $nodeset-&gt;size == 1;
	
	my $newset = XML::XPathEngine::NodeSet-&gt;new();
	$newset-&gt;push($nodeset-&gt;get_node(1)-&gt;getRootNode());
	return $newset;
}

1;
</pre></body></html>