<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># $Id: Root.pm 7909 2004-08-06 05:11:55Z mdewsnip $

package XML::XPath::Root;
use strict;
use XML::XPath::XMLParser;
use XML::XPath::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::XPath::NodeSet-&gt;new();
	$newset-&gt;push($nodeset-&gt;get_node(1)-&gt;getRootNode());
	return $newset;
}

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