Heray-Was-Here
Server : Apache
System : Linux vps43555.mylogin.co 3.10.0-1160.53.1.vz7.185.3 #1 SMP Tue Jan 25 12:49:12 MSK 2022 x86_64
User : redsea ( 60651)
PHP Version : 7.4.32
Disable Function : NONE
Directory :  /usr/local/share/perl5/XML/XPath/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/share/perl5/XML/XPath/Root.pm
package XML::XPath::Root;

$VERSION = '1.40';

use strict; use warnings;
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 "<Root/>\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 > 1 node!" unless $nodeset->size == 1;

	my $newset = XML::XPath::NodeSet->new();
	$newset->push($nodeset->get_node(1)->getRootNode());
	return $newset;
}

1;

Hry