blib/lib/HTML/Object/XPath/Function.pm untested

filter: Statementstmt 0.0% 0 / 268 Branchbran 0.0% 0 / 88 Conditioncond 0.0% 0 / 7 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 48 Podpod 0.0% 0 / 37 totaltotal 0.0% 0 / 448 CC 45 SCAR 22.4
CC
45
Cov
0%
id
30.0
number
20.0
contains
12.0
CRAP 9.3
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/XPath/Function.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/05
7 ## Modified 2022/09/18
8 ## All rights reserved
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::XPath::Function;
15 BEGIN
16 {
17 use strict;
18 use warnings;
19 warnings::register_categories( 'HTML::Object' );
20 use parent qw( Module::Generic );
21 use vars qw( $TRUE $FALSE $BASE_CLASS $DEBUG $VERSION );
22 use HTML::Object::XPath::Boolean;
23 our $TRUE = HTML::Object::XPath::Boolean->True;
24 our $FALSE = HTML::Object::XPath::Boolean->False;
25 our $BASE_CLASS = 'HTML::Object::XPath';
26 our $DEBUG = 0;
27 our $VERSION = 'v0.2.0';
28 };
29  
30 use strict;
31 use warnings;
32  
33 sub init
34 {
35 my $self = shift( @_ );
36 # XPath Parser -> HTML::Object::XPath
37 $self->{pp} = shift( @_ );
38 $self->{name} = shift( @_ );
39 $self->{params} = shift( @_ );
40 $self->{_init_strict_use_sub} = 1;
41 $self->SUPER::init( @_ ) || return( $self->pass_error );
42 return( $self );
43 }
44  
45 sub as_string
46 {
47 my $self = shift( @_ );
48 my $string = $self->{name} . '(';
49 my $second;
50 foreach( @{$self->{params}} )
51 {
52 $string .= ',' if( $second++ );
53 $string .= $_->as_string;
54 }
55 $string .= ')';
56 return( $string );
57 }
58  
59 sub as_xml
60 {
61 my $self = shift( @_ );
62 my $string = sprintf( '<Function name="%s"', $self->{name} );
63 my $params = '';
64 foreach( @{$self->{params}} )
65 {
66 $params .= '<Param>' . $_->as_xml . "</Param>\n";
67 }
68 if( $params )
69 {
70 $string .= ">\n$params</Function>\n";
71 }
72 else
73 {
74 $string .= " />\n";
75 }
76 return( $string );
77 }
78  
79 sub boolean
80 {
81 my $self = shift( @_ );
82 my( $node, @params ) = @_;
83 die( "boolean: Incorrect number of parameters\n" ) if( @params != 1 );
84 return( $params[0]->to_boolean );
85 }
86  
87 sub ceiling
88 {
89 my $self = shift( @_ );
90 my( $node, @params ) = @_;
91 require POSIX;
92 my $num = $self->number( $node, @params );
93 return( $self->new_number( POSIX::ceil( $num->value ) ) );
94 }
95  
96 sub concat
97 {
98 my $self = shift( @_ );
99 my( $node, @params ) = @_;
100 die( "concat: Too few parameters\n" ) if( @params < 2 );
101 # TODO: Check for improvement
102 my $string = join( '', map{ $_->string_value } @params );
103 return( $self->new_literal( $string ) );
104 }
105  
106 sub contains
107 {
108 my $self = shift( @_ );
109 my( $node, @params ) = @_;
110 die( "starts-with: incorrect number of params\n" ) unless( @params == 2 );
111 my $value = $params[1]->string_value;
112 if( $params[0]->string_value =~ /(.*?)\Q$value\E(.*)/ )
113 {
114 return( $TRUE );
115 }
116 return( $FALSE );
117 }
118  
119 sub count
120 {
121 my $self = shift( @_ );
122 my( $node, @params ) = @_;
123 die( "count: Parameter must be a NodeSet\n" ) unless( $params[0]->isa( 'HTML::Object::XPath::NodeSet' ) );
124 return( $self->new_number( $params[0]->size ) );
125 }
126  
127 sub evaluate
128 {
129 my $self = shift( @_ );
130 my $node = shift( @_ );
131 while( $node->isa( 'HTML::Object::XPath::NodeSet' ) )
132 {
133 $node = $node->get_node(1);
134 }
135 my @params;
136 foreach my $param ( @{$self->{params}} )
137 {
138 my $results = $param->evaluate( $node );
139 push( @params, $results );
140 }
141 return( $self->_execute( $self->{name}, $node, @params ) );
142 }
143  
144 sub false
145 {
146 my $self = shift( @_ );
147 my( $node, @params ) = @_;
148 die( "true: function takes no parameters\n" ) if( @params > 0 );
149 return( $FALSE );
150 }
151  
152 sub floor
153 {
154 my $self = shift( @_ );
155 my( $node, @params ) = @_;
156 require POSIX;
157 my $num = $self->number( $node, @params );
158 return( $self->new_number( POSIX::floor( $num->value ) ) );
159 }
160  
161 sub id
162 {
163 my $self = shift( @_ );
164 my( $node, @params ) = @_;
165 die( "id: Function takes 1 parameter\n" ) unless( @params == 1 );
166 my $results = $self->new_nodeset();
167 if( $self->_is_a( $params[0] => 'HTML::Object::XPath::NodeSet' ) )
168 {
169 # result is the union of applying id() to the
170 # string value of each node in the nodeset.
171 foreach my $node ( $params[0]->get_nodelist )
172 {
173 my $string = $node->string_value;
174 $results->append( $self->id( $node, $self->new_literal( $string ) ) );
175 }
176 }
177 # The actual id() function...
178 else
179 {
180 my $string = $self->string( $node, $params[0] );
181 # get perl scalar
182 # $_ = $string->value;
183 # split $_
184 # my @ids = split;
185 # die( "Splitting '", $string->value, "' with result: '", join( "', '", @ids ), "'\n" );
186 my @ids = split( /[[:blank:]]/, $string->value );
187 if( $node->isAttributeNode )
188 {
189 warn( "calling \($node->getParentNode->getRootNode->getChildNodes)->[0] on attribute node\n" );
190 $node = ( $node->getParentNode->getRootNode->getChildNodes )->[0];
191 }
192 foreach my $id ( @ids )
193 {
194 if( my $found = $node->getElementById( $id ) )
195 {
196 $results->push( $found );
197 }
198 }
199 }
200 return( $results );
201 }
202  
203 sub lang
204 {
205 my $self = shift( @_ );
206 my( $node, @params ) = @_;
207 die( "lang: function takes 1 parameter\n" ) if( @params != 1 );
208 my $lang = $node->findvalue( '(ancestor-or-self::*[@xml:lang]/@xml:lang)[1]' );
209 my $lclang = lc( $params[0]->string_value );
210 # warn("Looking for lang($lclang) in $lang\n");
211 if( substr( lc( $lang ), 0, length( $lclang ) ) eq $lclang )
212 {
213 return( $TRUE );
214 }
215 else
216 {
217 return( $FALSE );
218 }
219 }
220  
221 sub last
222 {
223 my $self = shift( @_ );
224 my( $node, @params ) = @_;
225 die( "last: function doesn't take parameters\n" ) if( scalar( @params ) );
226 return( $self->new_number( $self->{pp}->_get_context_size ) );
227 }
228  
229 sub local_name
230 {
231 my $self = shift( @_ );
232 my( $node, @params ) = @_;
233 if( @params > 1 )
234 {
235 die( "name() function takes one or no parameters\n" );
236 }
237 elsif( @params )
238 {
239 my $nodeset = shift( @params );
240 $node = $nodeset->get_node(1);
241 }
242 return( $self->new_literal( $node->getLocalName ) );
243 }
244  
245 sub name
246 {
247 my $self = shift( @_ );
248 my( $node, @params ) = @_;
249 if( @params > 1 )
250 {
251 die( "name() function takes one or no parameters\n" );
252 }
253 elsif( @params )
254 {
255 my $nodeset = shift( @params );
256 $node = $nodeset->get_node(1);
257 }
258 return( $self->new_literal( $node->getName ) );
259 }
260  
261 sub namespace_uri
262 {
263 my $self = shift( @_ );
264 my( $node, @params ) = @_;
265 die( "namespace-uri: Function not supported\n" );
266 }
267  
268 sub new_literal { return( shift->_class_for( 'Literal' )->new( @_ ) ); }
269  
270 sub new_nodeset { return( shift->_class_for( 'NodeSet' )->new( @_ ) ); }
271  
272 sub new_number { return( shift->_class_for( 'Number' )->new( @_ ) ); }
273  
274 sub normalize_space
275 {
276 my $self = shift( @_ );
277 my( $node, @params ) = @_;
278 die( "normalize-space: Wrong number of params\n" ) if( @params > 1 );
279 my $str;
280 if( @params )
281 {
282 $str = $params[0]->string_value;
283 }
284 else
285 {
286 $str = $node->string_value;
287 }
288 # $str =~ s/^\s*//;
289 # $str =~ s/\s*$//;
290 $str =~ s/^[[:blank:]\h]+|[[:blank:]\h]+$//g;
291 # $str =~ s/\s+/ /g;
292 $str =~ s/[[:blank:]\h]+/ /g;
293 return( $self->new_literal( $str ) );
294 }
295  
296 sub not
297 {
298 my $self = shift( @_ );
299 my( $node, @params ) = @_;
300 $params[0] = $params[0]->to_boolean unless( $params[0]->isa( 'HTML::Object::XPath::Boolean' ) );
301 return( $params[0]->value ? $FALSE : $TRUE );
302 }
303  
304 sub number
305 {
306 my $self = shift( @_ );
307 my( $node, @params ) = @_;
308 die( "number: Too many parameters\n" ) if( @params > 1 );
309 if( @params )
310 {
311 if( $params[0]->isa( 'HTML::Object::XPath::Node' ) )
312 {
313 return( $self->new_number( $params[0]->string_value ) );
314 }
315 return( $params[0]->to_number );
316 }
317 return( $self->new_number( $node->string_value ) );
318 }
319  
320 sub position
321 {
322 my $self = shift( @_ );
323 my( $node, @params ) = @_;
324 if( scalar( @params ) )
325 {
326 die( "position: function doesn't take parameters [ ", @params, " ]\n" );
327 }
328 # return pos relative to axis direction
329 return( $self->new_number( $self->{pp}->_get_context_pos ) );
330 }
331  
332 sub round
333 {
334 my $self = shift( @_ );
335 my( $node, @params ) = @_;
336 my $num = $self->number( $node, @params );
337 require POSIX;
338 # Yes, I know the spec says do not do this...
339 # return( $self->new_number( POSIX::floor( $num->value + 0.5 ) ) );
340 return( $self->new_number( CORE::sprintf( '%.*f', $num->value ) ) );
341 }
342  
343 sub starts_with
344 {
345 my $self = shift( @_ );
346 my( $node, @params ) = @_;
347 die( "starts-with: incorrect number of params\n" ) unless( @params == 2 );
348 my( $string1, $string2 ) = ( $params[0]->string_value, $params[1]->string_value );
349 if( substr( $string1, 0, length( $string2 ) ) eq $string2 )
350 {
351 return( $TRUE );
352 }
353 return( $FALSE );
354 }
355  
356 sub string
357 {
358 my $self = shift( @_ );
359 my( $node, @params ) = @_;
360 die( "string: Too many parameters\n" ) if( @params > 1 );
361 if( @params )
362 {
363 return( $self->new_literal( $params[0]->string_value ) );
364 }
365
366 # TODO - this MUST be wrong! - not sure now. -matt
367 return( $self->new_literal( $node->string_value ) );
368 # default to nodeset with just $node in.
369 }
370  
371 sub string_length
372 {
373 my $self = shift( @_ );
374 my( $node, @params ) = @_;
375 die( "string-length: Wrong number of params\n" ) if( @params > 1 );
376 if( @params )
377 {
378 return( $self->new_number( length( $params[0]->string_value ) ) );
379 }
380 else
381 {
382 return( $self->new_number( length( $node->string_value ) ) );
383 }
384 }
385  
386 sub substring
387 {
388 my $self = shift( @_ );
389 my( $node, @params ) = @_;
390 die( "substring: Wrong number of parameters\n" ) if( @params < 2 || @params > 3 );
391 my( $str, $offset, $len );
392 $str = $params[0]->string_value;
393 $offset = $params[1]->value;
394 # uses 1 based offsets
395 $offset--;
396 if( @params == 3 )
397 {
398 $len = $params[2]->value;
399 return( $self->new_literal( substr( $str, $offset, $len ) ) );
400 }
401 else
402 {
403 return( $self->new_literal( substr( $str, $offset ) ) );
404 }
405 }
406  
407 sub substring_after
408 {
409 my $self = shift( @_ );
410 my( $node, @params ) = @_;
411 die( "starts-with: incorrect number of params\n" ) unless( @params == 2 );
412 my $long = $params[0]->string_value;
413 my $short = $params[1]->string_value;
414 if( $long =~ m{\Q$short\E(.*)$} )
415 {
416 return( $self->new_literal( $1 ) );
417 }
418 else
419 {
420 return( $self->new_literal( '' ) );
421 }
422 }
423  
424 sub substring_before
425 {
426 my $self = shift( @_ );
427 my( $node, @params ) = @_;
428 die( "starts-with: incorrect number of params\n" ) unless( @params == 2 );
429 my $long = $params[0]->string_value;
430 my $short = $params[1]->string_value;
431 if( $long =~ m{^(.*?)\Q$short} )
432 {
433 return( $self->new_literal( $1 ) );
434 }
435 else
436 {
437 return( $self->new_literal( '' ) );
438 }
439 }
440  
441 sub sum
442 {
443 my $self = shift( @_ );
444 my( $node, @params ) = @_;
445 die( "sum: Parameter must be a NodeSet\n" ) unless( $params[0]->isa( 'HTML::Object::XPath::NodeSet' ) );
446 my $sum = 0;
447 foreach my $node ( $params[0]->get_nodelist )
448 {
449 $sum += $self->number( $node )->value;
450 }
451 return( $self->new_number( $sum ) );
452 }
453  
454 sub translate
455 {
456 my $self = shift( @_ );
457 my( $node, @params ) = @_;
458 die( "translate: Wrong number of params\n" ) if( @params != 3 );
459 local $_ = $params[0]->string_value;
460 my $find = $params[1]->string_value;
461 my $repl = $params[2]->string_value;
462 $repl= substr( $repl, 0, length( $find ) );
463 my %repl;
464 @repl{split( //, $find )} = split( //, $repl );
465 s{(.)}
466 {
467 CORE::exists( $repl{$1} ) ? defined( $repl{$1} ) ? $repl{$1} : '' : $1
468 }ges;
469 return( $self->new_literal( $_ ) );
470 }
471  
472 sub true
473 {
474 my $self = shift( @_ );
475 my( $node, @params ) = @_;
476 die( "true: function takes no parameters\n" ) if( @params > 0 );
477 return( $TRUE );
478 }
479  
480 sub _class_for
481 {
482 my( $self, $mod ) = @_;
483 eval( "require ${BASE_CLASS}\::${mod};" );
484 die( $@ ) if( $@ );
485 # ${"${BASE_CLASS}\::${mod}\::DEBUG"} = $DEBUG;
486 eval( "\$${BASE_CLASS}\::${mod}\::DEBUG = " . ( $DEBUG // 0 ) );
487 return( "${BASE_CLASS}::${mod}" );
488 }
489  
490 sub _execute
491 {
492 my $self = shift( @_ );
493 my( $name, $node, @params ) = @_;
494 return( $self->error( "No function name was provided to execute." ) ) if( !$name );
495 $name =~ s/-/_/g;
496 no strict 'refs';
497 return( $self->$name( $node, @params ) );
498 }
499  
500 1;
501 # NOTE: POD
502 __END__
503  
504 =encoding utf-8
505  
506 =head1 NAME
507  
508 HTML::Object::XPath::Function - HTML Object XPath Functions
509  
510 =head1 SYNOPSIS
511  
512 use HTML::Object::XPath::Function;
513 my $func = HTML::Object::XPath::Function->new ||
514 die( HTML::Object::XPath::Function->error, "\n" );
515  
516 =head1 VERSION
517  
518 v0.2.0
519  
520 =head1 DESCRIPTION
521  
522 This module implements various XPath functions described below.
523  
524 =head1 CONSTRUCTOR
525  
526 Provided with a L<XPath object|HTML::Object::XPath>, a function C<name> and function C<parameters> and this will instantiate a new L<HTML::Object::Function> object and return it.
527  
528 =head1 METHODS
529  
530 =head2 as_string
531  
532 Returns a string representation of this function object.
533  
534 =head2 as_xml
535  
536 Returns a xml representation of this function object.
537  
538 =head2 boolean
539  
540 Provided with a L<node object|HTML::Object::Element> and a list of parameters and this will return the first parameter as a L<boolean object|HTML::Object::XPath::Booleab>. It will raise an exception if there are more than one arguments provided.
541  
542 =head2 ceiling
543  
544 Provided with a L<node object|HTML::Object::Element> and an optional parameter, and this will return the L<ceiling|POSIX/ceil> of the string value of the node or that of the parameter provided, if any.
545  
546 It returns its value as a new L<number object|HTML::Object::XPath::Number>. It will raise an exception if more than one parameter was provided.
547  
548 =head2 concat
549  
550 Provided with a L<node object|HTML::Object::Element> and a list of 2 parameters or more and this will return a new L<literal object|HTML::Object::XPath::Literal> from the concatenation of each parameter string value.
551  
552 =head2 contains
553  
554 Provided with a L<node object|HTML::Object::Element> and a list of exactly 2 parameters and this will return L<true|HTML::Object::XPath::Boolean> if the first parameter match the second one as a regular expression, or returns L<false|HTML::Object::XPath::Boolean> otherwise.
555  
556 =head2 count
557  
558 Provided with a L<node object|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will return the size of the node set as a L<number|HTML::Object::XPath::Number>
559  
560 =head2 evaluate
561  
562 Provided with a L<node object|HTML::Object::Element> and this will evaluate the node using each parameter set during object instantiation and add the result for each in a new array.
563  
564 It will then return the execution of the function name on the node passing it the list of previously collected results.
565  
566 =head2 false
567  
568 Returns L<false|HTML::Object::XPath::Boolean> and it will raise an exception if any arguments was provided.
569  
570 =head2 floor
571  
572 Provided with a L<node object|HTML::Object::Element> and an optional parameter, and this will return the L<floor|
573 POSIX/floor> of the string value of the node or that of the parameter provided, if any.
574  
575 It returns its value as a new L<number object|HTML::Object::XPath::Number>. It will raise an exception if more than one parameter was provided.
576  
577 =head2 id
578  
579 Provided with a L<node object|HTML::Object::Element> and 1 parameter, and this will return a new L<node set|HTML::Object::XPath::NodeSet> of L<element object|HTML::Object::Element> who match the id found in the node provided.
580  
581 =head2 lang
582  
583 Provided with a L<node object|HTML::Object::Element> and 1 parameter, and this will return L<true|HTML::Object::XPath::Boolean> if the node lang, if any at all, match the one provide as a parameter, otherwise it returns L<false|HTML::Object::XPath::Boolean>.
584  
585 =head2 last
586  
587 This takes no argument and returns the size, as a L<number|HTML::Object::XPath::Number> of the nodes in the context set in XPath.
588  
589 =head2 local_name
590  
591 Provided with a L<node object|HTML::Object::Element> and optionally some parameter and this will return the local name of the node, or that of the first parameter provided, if any, as a L<literal object|HTML::Object::XPath::Literal>
592  
593 =head2 name
594  
595 Provided with a L<node object|HTML::Object::Element> and optionally some parameter and this will return the name of the node, or that of the first parameter provided, if any, as a L<literal object|HTML::Object::XPath::Literal>
596  
597 =head2 namespace_uri
598  
599 This is an unsupported function and it will raise an exception when called.
600  
601 =head2 new_literal
602  
603 Returns a new L<literal object|HTML::Object::XPath::Literal> passing it whatever arguments was provided.
604  
605 =head2 new_nodeset
606  
607 Returns a new L<node set object|HTML::Object::XPath::NodeSet> passing it whatever arguments was provided.
608  
609 =head2 new_number
610  
611 Returns a new L<number object|HTML::Object::XPath::Number> passing it whatever arguments was provided.
612  
613 =head2 normalize_space
614  
615 Provided with a L<node object|HTML::Object::Element> and optionally some parameter and this will take the string value of the node, or that of the first parameter, if any at al, and remove any leading or trailing spaces as well as replacing multiple spaces by just one space, and return the new string as a L<literal object|HTML::Object::XPath::Literal>
616  
617 =head2 not
618  
619 Provided with a L<node object|HTML::Object::Element> and one parameter and this will return L<true|HTML::Object::XPath::Boolean> if the value of the first parameter is B<not> true, or L<false|HTML::Object::XPath::Boolean> otherwise.
620  
621 =head2 number
622  
623 Provided with a L<node object|HTML::Object::Element> and optionally one parameter and this will return the node string value, or that of the parameter provided, if any, as a new L<number object|HTML::Object::XPath::Number>
624  
625 =head2 position
626  
627 Returns th context position as a L<number|HTML::Object::XPath::Number>. It will raise an exception if any parameter was provided.
628  
629 =head2 round
630  
631 =head2 starts_with
632  
633 Provided with a L<node object|HTML::Object::Element> and two parameters and this will return L<true|HTML::Object::XPath::Boolean> if the string value of the second parameter is at the beginning of the first parameter, or L<false|HTML::Object::XPath::Boolean> otherwise.
634  
635 =head2 string
636  
637 Provided with a L<node object|HTML::Object::Element> and one parameter and this returns the parameter string value as a new L<literal object|HTML::Object::XPath::Literal>
638  
639 It will raise an exception if more than one parameter was provided.
640  
641 =head2 string_length
642  
643 Provided with a L<node object|HTML::Object::Element> and optionally one parameter and this will return the size, as a L<number|HTML::Object::XPath::Number>, of the string value of the node or that of the parameter if any was provided.
644  
645 =head2 substring
646  
647 Provided with a L<node object|HTML::Object::Element> and two or three parameters and this returns the substring of of the first parameter as a value, at offset specified by the second parameter, and optionally for a length defined by a third parameter, if any. If no third parameter is provided, then it will be until the end of the string.
648  
649 It returns the substring as a new L<literal object|HTML::Object::XPath::Literal>. It will raise an exception if less than 2 or more than 3 parameters were provided.
650  
651 =head2 substring_after
652  
653 Provided with a L<node object|HTML::Object::Element> and two parameters and this will return the string that follows the string value of the second parameter in the first one up to its end.
654  
655 It returns the substring as a new L<literal object|HTML::Object::XPath::Literal>. It will raise an exception if less or more than 2 parameters were provided.
656  
657 =head2 substring_before
658  
659 Provided with a L<node object|HTML::Object::Element> and two parameters and this will return the string that precede the string value of the second parameter in the first one up to its start.
660  
661 It returns the substring as a new L<literal object|HTML::Object::XPath::Literal>. It will raise an exception if less or more than 2 parameters were provided.
662  
663 =head2 sum
664  
665 Provided with a L<node object|HTML::Object::Element> and a parameters that must be a L<node set|HTML::Object::XPath::NodeSet> and this will return the cumulative string value of each node as a number.
666  
667 It returns the resulting total as a new L<number> object|HTML::Object::XPath::Number>. It will raise an exception if the parameter provided is not a L<HTML::Object::XPath::NodeSet> object.
668  
669 =head2 translate
670  
671 Provided with a L<node object|HTML::Object::Element> and three parameters, and this will search in the first parameter for any occurrence of characters found in the second parameter and replace them with their alternative at the exact same position in string in the third parameter.
672  
673 It returns the substring as a new L<literal object|HTML::Object::XPath::Literal>. It will raise an exception if less or more than 3 parameters were provided.
674  
675 =head2 true
676  
677 Returns L<true|HTML::Object::XPath::Boolean> and it will raise an exception if any arguments was provided.
678  
679 =head1 AUTHOR
680  
681 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
682  
683 =head1 SEE ALSO
684  
685 L<HTML::Object::XPath>, L<HTML::Object::XPath::Boolean>, L<HTML::Object::XPath::Expr>, L<HTML::Object::XPath::Function>, L<HTML::Object::XPath::Literal>, L<HTML::Object::XPath::LocationPath>, L<HTML::Object::XPath::NodeSet>, L<HTML::Object::XPath::Number>, L<HTML::Object::XPath::Root>, L<HTML::Object::XPath::Step>, L<HTML::Object::XPath::Variable>
686  
687 =head1 COPYRIGHT & LICENSE
688  
689 Copyright(c) 2021 DEGUEST Pte. Ltd.
690  
691 All rights reserved
692  
693 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
694  
695 =cut