lib/HTML/Object/XPath/Step.pm

filter: Statementstmt 61.2% 185 / 302 Branchbran 43.6% 76 / 174 Conditioncond 46.6% 28 / 60 MC/DCmcdc 29.7% 11 / 37 Subroutinesub 71.4% 30 / 42 Podpod 100% 27 / 27 totaltotal 55.6% 357 / 642 CC 115 SCAR 37.0
CC
115
Cov
54%
node_test
127.1
as_string
110.0
as_xml
110.0
CRAP 40.6
« lib/HTML/Object/DOM/File.pm ↑ Summary lib/HTML/Object/DOM/Element/Table.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/XPath/Step.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::Step;
15 BEGIN
16 {
17 12 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 12 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 12 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 12 ▶ use parent qw( Module::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 12 ▶ use vars qw( $BASE_CLASS $DEBUG $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 use constant {
23 # Full name
24 12 TEST_QNAME => 0,
25 # NCName:*
26 TEST_NCWILD => 1,
27 # *
28 TEST_ANY => 2,
29 # @ns:attrib
30 TEST_ATTR_QNAME => 3,
31 # @nc:*
32 TEST_ATTR_NCWILD => 4,
33 # @*
34 TEST_ATTR_ANY => 5,
35 # comment()
36 TEST_NT_COMMENT => 6,
37 # text()
38 TEST_NT_TEXT => 7,
39 # processing-instruction()
40 TEST_NT_PI => 8,
41 # node()
42 TEST_NT_NODE => 9,
43 12 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
44 12 our $BASE_CLASS = 'HTML::Object::XPath';
45 12 our $DEBUG = 0;
46 12 our $VERSION = 'v0.2.0';
47 };
48  
49 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
51  
52 sub init
53 {
54 159 ▶ my $self = shift( @_ );
Subroutine init: called CC=2 SCAR=6.9
Pod documented
55 # HTML::Object::XPath class
56 159 $self->{pp} = shift( @_ );
57 159 $self->{axis} = shift( @_ );
58 159 $self->{test} = shift( @_ );
59 159 $self->{literal} = shift( @_ );
60 159 $self->{predicates} = [];
61 159 $self->{axis_method} = 'axis_' . $self->{axis};
62 159 $self->{axis_method} =~ tr/-/_/;
63 # my( $pp, $axis, $test, $literal) = @_;
64 159 my $axis_method = "axis_$self->{axis}";
65 159 $axis_method =~ tr/-/_/;
66 159 $self->{_init_strict_use_sub} = 1;
67 159 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 159 159
68 159 return( $self );
69 }
70  
71 sub as_string
72 {
73 0 ▶ my $self = shift( @_ );
Subroutine as_string: not called CC=10 SCAR=47.0
Pod documented
74 0 my $string = $self->{axis} . '::';
75 0 my $test = $self->{test};
76 0 ▶ if( $test == TEST_NT_PI )
Branch: 5 branches
BranchTrueFalseTotal
if ($test == 8) { } 0 0 0
elsif ($test == 6) { } 0 0 0
elsif ($test == 7) { } 0 0 0
elsif ($test == 9) { } 0 0 0
elsif ($test == 1 or $test == 4) { } 0 0 0
77 {
78 0 $string .= 'processing-instruction(';
79 0 ▶ if( $self->{literal}->value )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"literal"}->value) 0 0 0
80 {
81 0 $string .= $self->{literal}->as_string;
82 }
83 0 $string .= ')';
84 }
85 elsif ($test == TEST_NT_COMMENT )
86 {
87 0 $string .= 'comment()';
88 }
89 elsif ($test == TEST_NT_TEXT )
90 {
91 0 $string .= 'text()';
92 }
93 elsif ($test == TEST_NT_NODE )
94 {
95 0 $string .= 'node()';
96 }
97 ▶ elsif ($test == TEST_NCWILD || $test == TEST_ATTR_NCWILD )
Condition0%0/3
$test == 1 or $test == 4
l!l&&r!l&&!r
000
MC/DC0%0/2
$test == 1 or $test == 4
$test == 1 $test == 4
Truth table0%0/3
A or B
A= $test == 1B= $test == 4
ABresult
1X1
011
000
98 {
99 0 $string .= $self->{literal} . ':*';
100 }
101 else
102 {
103 0 $string .= $self->{literal};
104 }
105
106 0 foreach( @{$self->{predicates}} )
107 {
108 0 ▶ next unless( defined( $_ ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_ 0 0 0
109 0 $string .= '[' . $_->as_string . ']';
110 }
111 0 return( $string );
112 }
113  
114 sub as_xml
115 {
116 0 ▶ my $self = shift( @_ );
Subroutine as_xml: not called CC=10 SCAR=47.0
Pod documented
117 0 my $string = "<Step>\n";
118 0 $string .= "<Axis>" . $self->{axis} . "</Axis>\n";
119 0 my $test = $self->{test};
120
121 0 $string .= "<Test>";
122
123 0 ▶ if( $test == TEST_NT_PI )
Branch: 5 branches
BranchTrueFalseTotal
if ($test == 8) { } 0 0 0
elsif ($test == 6) { } 0 0 0
elsif ($test == 7) { } 0 0 0
elsif ($test == 9) { } 0 0 0
elsif ($test == 1 or $test == 4) { } 0 0 0
124 {
125 0 $string .= '<processing-instruction';
126 0 ▶ if( $self->{literal}->value )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'literal'}->value) { } 0 0 0
127 {
128 0 $string .= '>';
129 0 $string .= $self->{literal}->as_string;
130 0 $string .= '</processing-instruction>';
131 }
132 else
133 {
134 0 $string .= '/>';
135 }
136 }
137 elsif( $test == TEST_NT_COMMENT )
138 {
139 0 $string .= '<comment/>';
140 }
141 elsif( $test == TEST_NT_TEXT )
142 {
143 0 $string .= '<text/>';
144 }
145 elsif( $test == TEST_NT_NODE )
146 {
147 0 $string .= '<node/>';
148 }
149 ▶ elsif( $test == TEST_NCWILD || $test == TEST_ATTR_NCWILD )
Condition0%0/3
$test == 1 or $test == 4
l!l&&r!l&&!r
000
MC/DC0%0/2
$test == 1 or $test == 4
$test == 1 $test == 4
Truth table0%0/3
A or B
A= $test == 1B= $test == 4
ABresult
1X1
011
000
150 {
151 0 $string .= '<namespace-prefix>' . $self->{literal} . '</namespace-prefix>';
152 }
153 else
154 {
155 0 $string .= '<nametest>' . $self->{literal} . '</nametest>';
156 }
157 0 $string .= "</Test>\n";
158
159 0 foreach( @{$self->{predicates}} )
160 {
161 0 ▶ next unless( defined( $_ ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_ 0 0 0
162 0 $string .= "<Predicate>\n" . $_->as_xml() . "</Predicate>\n";
163 }
164 0 $string .= "</Step>\n";
165 0 return( $string );
166 }
167  
168 82 ▶sub axis { return( shift->_set_get_scalar( 'axis', @_ ) ); }
Subroutine axis: called CC=1 SCAR=0.0
Pod documented
169  
170 sub axis_ancestor
171 {
172 0 ▶ my $self = shift( @_ );
Subroutine axis_ancestor: not called CC=3 SCAR=24.8
Pod documented
173 0 my( $context, $results ) = @_;
174 0 my $parent = $context->getParentNode;
175  
176 # START:
177 # return( $results ) unless( $parent );
178 # if( $self->node_test( $parent ) )
179 # {
180 # $results->push( $parent );
181 # }
182 # $parent = $parent->getParentNode;
183 # goto( START );
184 0 ▶ while( $parent )
Branch: 1 branch
BranchTrueFalseTotal
if ($parent) 0 0 0
185 {
186 0 ▶ if( $self->node_test( $parent ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($parent)) 0 0 0
187 {
188 0 $results->push( $parent );
189 }
190 0 $parent = $parent->getParentNode;
191 }
192 0 return( $results );
193 }
194  
195 sub axis_ancestor_or_self
196 {
197 0 ▶ my $self = shift( @_ );
Subroutine axis_ancestor_or_self: not called CC=3 SCAR=24.8
Pod documented
198 0 my( $context, $results ) = @_;
199
200 # START:
201 # return $results unless $context;
202 # if( $self->node_test( $context ) )
203 # {
204 # $results->push( $context );
205 # }
206 # $context = $context->getParentNode;
207 # goto START;
208 0 ▶ while( $context )
Branch: 1 branch
BranchTrueFalseTotal
if ($context) 0 0 0
209 {
210 0 ▶ if( $self->node_test( $context ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($context)) 0 0 0
211 {
212 0 $results->push( $context );
213 }
214 0 $context = $context->getParentNode;
215 }
216 0 return( $results );
217 }
218  
219 sub axis_attribute
220 {
221 204 ▶ my $self = shift( @_ );
Subroutine axis_attribute: called CC=3 SCAR=11.0
Pod documented
222 204 my( $context, $results ) = @_;
223
224 204 foreach my $attrib ( @{$context->getAttributes} )
225 {
226 433 ▶ if( $self->test_attribute( $attrib ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->test_attribute($attrib)) 187 246 433
227 {
228 187 $results->push( $attrib );
229 }
230 }
231 }
232  
233 sub axis_child
234 {
235 455 ▶ my $self = shift( @_ );
Subroutine axis_child: called CC=3 SCAR=11.0
Pod documented
236 455 my( $context, $results ) = @_;
237 455 my $children = $context->getChildNodes;
238
239 454 foreach my $node ( @{$context->getChildNodes} )
240 {
241 452 ▶ if( $self->node_test( $node ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($node)) 150 302 452
242 {
243 150 $results->push( $node );
244 }
245 }
246 }
247  
248 sub axis_descendant
249 {
250 35 ▶ my $self = shift( @_ );
Subroutine axis_descendant: called CC=3 SCAR=11.0
Pod documented
251 35 my( $context, $results ) = @_;
252  
253 35 my @queue = $context->getChildNodes;
254  
255 35 ▶ while( @queue )
Branch: 1 branch
BranchTrueFalseTotal
if (@queue) 1047 35 1082
256 {
257 1047 my $node = shift( @queue );
258 1047 ▶ if( $self->node_test( $node ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($node)) { } 104 943 1047
259 {
260 104 $results->push( $node );
261 }
262 else
263 {
264 # Node failed the test.
265 }
266 1047 push( @queue, $node->getChildNodes );
267 }
268 }
269  
270 sub axis_descendant_or_self
271 {
272 26 ▶ my $self = shift( @_ );
Subroutine axis_descendant_or_self: called CC=3 SCAR=11.0
Pod documented
273 26 my( $context, $results ) = @_;
274  
275 # Use a queue (FIFO) instead of a stack (LIFO) for traversal.
276 # push/shift (BFS) vs unshift/shift (DFS) yields the same node set for
277 # descendant-or-self since all nodes are visited regardless of order.
278 # BFS is O(1) per enqueue (push appends), whereas DFS via unshift is
279 # O(n) per step because it must shift all existing elements rightward.
280 # On a document with many siblings, this makes a significant difference
281 # in both CPU time and peak memory (the queue never grows beyond the
282 # width of the widest level, vs a DFS stack that holds entire subtrees).
283 26 my @queue = ( $context );
284  
285 26 ▶ while( @queue )
Branch: 1 branch
BranchTrueFalseTotal
if (@queue) 471 26 497
286 {
287 471 my $node = shift( @queue );
288 471 ▶ if( $self->node_test( $node ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($node)) 471 0 471
289 {
290 471 $results->push( $node );
291 }
292 471 push( @queue, $node->getChildNodes );
293 }
294 }
295  
296 sub axis_following
297 {
298 5 ▶ my $self = shift( @_ );
Subroutine axis_following: called CC=6 SCAR=18.0
Pod documented
299 5 my( $context, $results ) = @_;
300  
301 5 ▶ my $elt = $context->getNextSibling || _next_sibling_of_an_ancestor_of( $context );
Condition33%1/3
$context->getNextSibling || _next_sibling_of_an_ancestor_of($context)
l!l&&r!l&&!r
500
MC/DC0%0/2
$context->getNextSibling || _next_sibling_of_an_ancestor_of($context)
$context->getNextSibling _next_sibling_of_an_ancestor_of($context)
Truth table33%1/3
A || B
A= $context->getNextSiblingB= _next_sibling_of_an_ancestor_of($context)
ABresult
1X1
011
000
302 5 ▶ while( $elt )
Branch: 1 branch
BranchTrueFalseTotal
if ($elt) 30 5 35
303 {
304 30 ▶ if( $self->node_test( $elt ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($elt)) 9 21 30
305 {
306 9 $results->push( $elt );
307 }
308 30 ▶ $elt = $elt->getFirstChild || $elt->getNextSibling || _next_sibling_of_an_ancestor_of( $elt );
Condition100%6/6
$elt->getFirstChild || $elt->getNextSibling || _next_sibling_of_an_ancestor_of($elt)
l!l&&r!l&&!r
2055
$elt->getFirstChild or $elt->getNextSibling
l!l&&r!l&&!r
101010
MC/DC100%3/3
$elt->getFirstChild || $elt->getNextSibling || _next_sibling_of_an_ancestor_of($elt)
$elt->getFirstChild $elt->getNextSibling _next_sibling_of_an_ancestor_of($elt)
Truth table100%4/4
A or B || C
A= $elt->getFirstChildB= $elt->getNextSiblingC= _next_sibling_of_an_ancestor_of($elt)
ABCresult
1XX1
01X1
0011
0000
309 }
310 }
311  
312 sub axis_following_sibling
313 {
314 0 ▶ my $self = shift( @_ );
Subroutine axis_following_sibling: not called CC=3 SCAR=24.8
Pod documented
315 0 my( $context, $results ) = @_;
316  
317 # warn "in axis_following_sibling";
318 0 ▶ while( $context = $context->getNextSibling )
Branch: 1 branch
BranchTrueFalseTotal
if ($context = $context->getNextSibling) 0 0 0
319 {
320 0 ▶ if( $self->node_test( $context ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($context)) 0 0 0
321 {
322 0 $results->push( $context );
323 }
324 }
325 }
326  
327 29 ▶sub axis_method { return( shift->_set_get_scalar( 'axis_method', @_ ) ); }
Subroutine axis_method: called CC=1 SCAR=0.0
Pod documented
328  
329 sub axis_namespace
330 {
331 0 ▶ my $self = shift( @_ );
Subroutine axis_namespace: not called CC=4 SCAR=30.0
Pod documented
332 0 my( $context, $results ) = @_;
333
334 0 ▶ return( $results ) unless( $context->isElementNode );
Branch: 1 branch
BranchTrueFalseTotal
unless $context->isElementNode 0 0 0
335 0 foreach my $ns ( @{$context->getNamespaces} )
336 {
337 0 ▶ if( $self->test_namespace( $ns ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->test_namespace($ns)) 0 0 0
338 {
339 0 $results->push( $ns );
340 }
341 }
342 }
343  
344 sub axis_parent
345 {
346 39 ▶ my $self = shift( @_ );
Subroutine axis_parent: called CC=3 SCAR=11.2
Pod documented
347 39 my( $context, $results ) = @_;
348
349 39 my $parent = $context->getParentNode;
350 38 ▶ return( $results ) unless( $parent );
Branch: 1 branch
BranchTrueFalseTotal
unless $parent 0 38 38
351 38 ▶ if( $self->node_test( $parent ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($parent)) 38 0 38
352 {
353 38 $results->push( $parent );
354 }
355 }
356  
357 sub axis_preceding
358 {
359 3 ▶ my $self = shift( @_ );
Subroutine axis_preceding: called CC=6 SCAR=18.0
Pod documented
360 3 my( $context, $results ) = @_;
361  
362 3 ▶ my $elt = $context->getPreviousSibling || _previous_sibling_of_an_ancestor_of( $context );
Condition33%1/3
$context->getPreviousSibling || _previous_sibling_of_an_ancestor_of($context)
l!l&&r!l&&!r
300
MC/DC0%0/2
$context->getPreviousSibling || _previous_sibling_of_an_ancestor_of($context)
$context->getPreviousSibling _previous_sibling_of_an_ancestor_of($context)
Truth table33%1/3
A || B
A= $context->getPreviousSiblingB= _previous_sibling_of_an_ancestor_of($context)
ABresult
1X1
011
000
363 3 ▶ while( $elt )
Branch: 1 branch
BranchTrueFalseTotal
if ($elt) 18 3 21
364 {
365 18 ▶ if( $self->node_test( $elt ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($elt)) 6 12 18
366 {
367 6 $results->push( $elt );
368 }
369 18 ▶ $elt = $elt->getLastChild || $elt->getPreviousSibling || _previous_sibling_of_an_ancestor_of( $elt );
Condition100%6/6
$elt->getLastChild || $elt->getPreviousSibling || _previous_sibling_of_an_ancestor_of($elt)
l!l&&r!l&&!r
1233
$elt->getLastChild or $elt->getPreviousSibling
l!l&&r!l&&!r
666
MC/DC100%3/3
$elt->getLastChild || $elt->getPreviousSibling || _previous_sibling_of_an_ancestor_of($elt)
$elt->getLastChild $elt->getPreviousSibling _previous_sibling_of_an_ancestor_of($elt)
Truth table100%4/4
A or B || C
A= $elt->getLastChildB= $elt->getPreviousSiblingC= _previous_sibling_of_an_ancestor_of($elt)
ABCresult
1XX1
01X1
0011
0000
370 }
371 }
372  
373 sub axis_preceding_sibling
374 {
375 0 ▶ my $self = shift( @_ );
Subroutine axis_preceding_sibling: not called CC=3 SCAR=24.8
Pod documented
376 0 my( $context, $results ) = @_;
377 0 ▶ while( $context = $context->getPreviousSibling )
Branch: 1 branch
BranchTrueFalseTotal
if ($context = $context->getPreviousSibling) 0 0 0
378 {
379 0 ▶ if( $self->node_test( $context ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($context)) 0 0 0
380 {
381 0 $results->push( $context );
382 }
383 }
384 }
385  
386 sub axis_self
387 {
388 81 ▶ my $self = shift( @_ );
Subroutine axis_self: called CC=2 SCAR=7.0
Pod documented
389 81 my( $context, $results ) = @_;
390
391 81 ▶ if( $self->node_test( $context ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->node_test($context)) 81 0 81
392 {
393 81 $results->push( $context );
394 }
395 }
396  
397 sub evaluate
398 {
399 357 ▶ my $self = shift( @_ );
Subroutine evaluate: called CC=4 SCAR=13.9
Pod documented
400 # context nodeset
401 357 my $from = shift( @_ );
402  
403 357 ▶ if( $from && !$from->isa( 'HTML::Object::XPath::NodeSet' ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($from and not $from->isa("HTML::Object::XPath::NodeSet")) 3 354 357
Condition100%3/3
$from and not $from->isa("HTML::Object::XPath::NodeSet")
!ll&&!rl&&r
13533
MC/DC100%2/2
$from and not $from->isa("HTML::Object::XPath::NodeSet")
$from not $from->isa("HTML::Object::XPath::NodeSet")
Truth table100%3/3
A and not(B)
A= $fromB= not $from->isa("HTML::Object::XPath::NodeSet")
ABresult
0X0
100
111
404 {
405 3 my $from_nodeset = $self->new_nodeset();
406 3 $from_nodeset->push( $from );
407 3 $from = $from_nodeset;
408 }
409 # warn "Step::evaluate called with ", $from->size, " length nodeset\n";
410
411 357 my $saved_context = $self->{pp}->_get_context_set;
412 357 my $saved_pos = $self->{pp}->_get_context_pos;
413 357 $self->{pp}->_set_context_set( $from );
414
415 357 my $initial_nodeset = $self->new_nodeset();
416
417 # See spec section 2.1, paragraphs 3,4,5:
418 # The node-set selected by the location step is the node-set
419 # that results from generating an initial node set from the
420 # axis and node-test, and then filtering that node-set by
421 # each of the predicates in turn.
422
423 # Make each node in the nodeset be the context node, one by one
424 357 ▶ for( my $i = 1; $i <= $from->size; $i++ )
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $from->size) 848 354 1202
425 {
426 848 $self->{pp}->_set_context_pos( $i );
427 # Capture the intermediate NodeSet in a lexical variable and release
428 # it immediately after appending its nodes to $initial_nodeset.
429 # Without this, the temporary NodeSet returned by evaluate_node()
430 # would stay alive until the end of the for() scope, causing
431 # accumulated memory pressure when $from is large (e.g. after a
432 # descendant-or-self step that returns every node in the document).
433 {
434 848 my $tmp = $self->evaluate_node( $from->get_node( $i ) );
435 845 $initial_nodeset->append( $tmp );
436 }
437 }
438
439 # warn "Step::evaluate initial nodeset size: ", $initial_nodeset->size, "\n";
440
441 354 $self->{pp}->_set_context_set( $saved_context );
442 354 $self->{pp}->_set_context_pos( $saved_pos );
443 354 return( $initial_nodeset );
444 }
445  
446 # Evaluate the step against a particular node
447 sub evaluate_node
448 {
449 848 ▶ my $self = shift( @_ );
Subroutine evaluate_node: called CC=3 SCAR=11.0
Pod documented
450 848 my $context = shift( @_ );
451 # warn "Evaluate node: $self->{axis}\n";
452 # warn "Node: ", $context->[node_name], "\n";
453 848 my $method = $self->{axis_method};
454
455 848 my $results = $self->new_nodeset();
456 12 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
457 848 eval{ $self->$method( $context, $results ); };
458 848 ▶ if( $@ )
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 3 845 848
459 {
460 3 die( "axis $method not implemented [$@]\n" );
461 }
462
463 # warn("results: ", join('><', map {$_->string_value} @$results), "\n");
464 # filter initial nodeset by each predicate
465 845 foreach my $predicate ( @{$self->{predicates}} )
466 {
467 462 $results = $self->filter_by_predicate( $results, $predicate );
468 }
469 845 return( $results );
470 }
471  
472 sub filter_by_predicate
473 {
474 462 ▶ my $self = shift( @_ );
Subroutine filter_by_predicate: called CC=8 SCAR=20.8
Pod documented
475 462 my( $nodeset, $predicate ) = @_;
476
477 # See spec section 2.4, paragraphs 2 & 3:
478 # For each node in the node-set to be filtered, the predicate Expr
479 # is evaluated with that node as the context node, with the number
480 # of nodes in the node set as the context size, and with the
481 # proximity position of the node in the node set with respect to
482 # the axis as the context position.
483 # use ref because nodeset has a bool context
484 462 ▶ if( !ref( $nodeset ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $nodeset) 0 462 462
485 {
486 0 die( "No nodeset!!!" );
487 }
488
489 # warn "Filter by predicate: $predicate\n";
490
491 462 my $newset = $self->new_nodeset();
492  
493 462 ▶ for( my $i = 1; $i <= $nodeset->size; $i++ )
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $nodeset->size) 171 448 619
494 {
495 # set context set each time 'cos a loc-path in the expr could change it
496 171 $self->{pp}->_set_context_set( $nodeset );
497 171 $self->{pp}->_set_context_pos( $i );
498 171 my $result = $predicate->evaluate( $nodeset->get_node( $i ) );
499 171 ▶ if( $result->isa( 'HTML::Object::XPath::Boolean' ) )
Branch: 2 branches
BranchTrueFalseTotal
if ($result->isa('HTML::Object::XPath::Boolean')) { } 138 33 171
elsif ($result->isa('HTML::Object::XPath::Number')) { } 17 16 33
500 {
501 138 ▶ if( $result->value )
Branch: 1 branch
BranchTrueFalseTotal
if ($result->value) 47 91 138
502 {
503 47 $newset->push( $nodeset->get_node( $i ) );
504 }
505 }
506 elsif( $result->isa( 'HTML::Object::XPath::Number' ) )
507 {
508 17 ▶ if( $result->value == $i )
Branch: 1 branch
BranchTrueFalseTotal
if ($result->value == $i) 14 3 17
509 {
510 14 $newset->push( $nodeset->get_node( $i ) );
511 14 last;
512 }
513 }
514 else
515 {
516 16 ▶ if( $result->to_boolean->value )
Branch: 1 branch
BranchTrueFalseTotal
if ($result->to_boolean->value) 10 6 16
517 {
518 10 $newset->push( $nodeset->get_node( $i ) );
519 }
520 }
521 }
522 462 return( $newset );
523 }
524  
525 0 ▶sub literal { return( shift->_set_get_scalar( 'literal', @_ ) ); }
Subroutine literal: not called CC=1 SCAR=6.9
Pod documented
526  
527 1670 ▶sub new_nodeset { return( shift->_class_for( 'NodeSet' )->new( @_ ) ); }
Subroutine new_nodeset: called CC=1 SCAR=0.0
Pod documented
528  
529 sub node_test
530 {
531 2137 ▶ my $self = shift( @_ );
Subroutine node_test: called CC=25 SCAR=48.5
Pod documented
532 2137 my $node = shift( @_ );
533 2137 my $test_types = [qw( TEST_QNAME TEST_NCWILD TEST_ANY TEST_ATTR_QNAME TEST_ATTR_NCWILD TEST_ATTR_ANY TEST_NT_COMMENT TEST_NT_TEXT TEST_NT_PI TEST_NT_NODE )];
534
535 # if node passes test, return true
536 2137 my $test = $self->{test};
537  
538 2137 ▶ return(1) if( $test == TEST_NT_NODE );
Branch: 1 branch
BranchTrueFalseTotal
if $test == 9 552 1585 2137
539  
540 1585 ▶ if( $test == TEST_ANY )
Branch: 1 branch
BranchTrueFalseTotal
if ($test == 2) 220 1365 1585
541 {
542 220 ▶ return(1) if( $node->isElementNode && defined( $node->getName ) );
Branch: 1 branch
BranchTrueFalseTotal
if $node->isElementNode and defined $node->getName 149 71 220
Condition66%2/3
$node->isElementNode and defined $node->getName
!ll&&!rl&&r
710149
MC/DC50%1/2
$node->isElementNode and defined $node->getName
$node->isElementNode defined $node->getName
Truth table66%2/3
A and B
A= $node->isElementNodeB= defined $node->getName
ABresult
0X0
100
111
543 }
544
545 # local $^W;
546 1436 ▶ if( $test == TEST_NCWILD )
Branch: 6 branches
BranchTrueFalseTotal
if ($test == 1) { } 0 1436 1436
elsif ($test == 0) { } 1365 71 1436
elsif ($test == 7) { } 0 71 71
elsif ($test == 6) { } 0 71 71
elsif ($test == 8 and not $self->{'literal'}) { } 0 71 71
elsif ($test == 8) { } 0 71 71
547 {
548 0 ▶ return unless( $node->isElementNode );
Branch: 1 branch
BranchTrueFalseTotal
unless $node->isElementNode 0 0 0
549 0 return( $self->_match_ns( $node ) );
550 }
551 elsif( $test == TEST_QNAME )
552 {
553 1365 ▶ return unless( $node->isElementNode );
Branch: 1 branch
BranchTrueFalseTotal
unless $node->isElementNode 530 835 1365
554 835 ▶ if( $self->{literal} =~ /:/ || $self->{pp}->{strict_namespaces} )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'literal'} =~ /:/ or $self->{'pp'}{'strict_namespaces'}) { } 0 835 835
Condition33%1/3
$self->{"literal"} =~ /:/ or $self->{"pp"}{"strict_namespaces"}
l!l&&r!l&&!r
00835
MC/DC0%0/2
$self->{"literal"} =~ /:/ or $self->{"pp"}{"strict_namespaces"}
$self->{"literal"} =~ /:/ $self->{"pp"}{"strict_namespaces"}
Truth table33%1/3
A or B
A= $self->{"literal"} =~ /:/B= $self->{"pp"}{"strict_namespaces"}
ABresult
1X1
011
000
555 {
556 0 my( $prefix, $name ) = _name2prefix_and_local_name( $self->{literal} );
557 0 ▶ return(1) if( ( $name eq $node->getLocalName ) && $self->_match_ns( $node ) );
Branch: 1 branch
BranchTrueFalseTotal
if $name eq $node->getLocalName and $self->_match_ns($node) 0 0 0
Condition0%0/3
$name eq $node->getLocalName and $self->_match_ns($node)
!ll&&!rl&&r
000
MC/DC0%0/2
$name eq $node->getLocalName and $self->_match_ns($node)
$name eq $node->getLocalName $self->_match_ns($node)
Truth table0%0/3
A and B
A= $name eq $node->getLocalNameB= $self->_match_ns($node)
ABresult
0X0
100
111
558 }
559 else
560 {
561 835 ▶ return(1) if( $node->getName eq $self->{literal} );
Branch: 1 branch
BranchTrueFalseTotal
if $node->getName eq $self->{"literal"} 158 677 835
562 }
563 }
564 elsif( $test == TEST_NT_TEXT )
565 {
566 0 ▶ return(1) if( $node->isTextNode );
Branch: 1 branch
BranchTrueFalseTotal
if $node->isTextNode 0 0 0
567 }
568 elsif( $test == TEST_NT_COMMENT )
569 {
570 0 ▶ return(1) if( $node->isCommentNode );
Branch: 1 branch
BranchTrueFalseTotal
if $node->isCommentNode 0 0 0
571 }
572 ▶ elsif( $test == TEST_NT_PI && !$self->{literal} )
Condition33%1/3
$test == 8 and not $self->{"literal"}
!ll&&!rl&&r
7100
MC/DC0%0/2
$test == 8 and not $self->{"literal"}
$test == 8 not $self->{"literal"}
Truth table33%1/3
A and not(B)
A= $test == 8B= not $self->{"literal"}
ABresult
0X0
100
111
573 {
574 0 ▶ return(1) if( $node->isPINode );
Branch: 1 branch
BranchTrueFalseTotal
if $node->isPINode 0 0 0
575 }
576 elsif( $test == TEST_NT_PI )
577 {
578 0 ▶ return unless( $node->isPINode );
Branch: 1 branch
BranchTrueFalseTotal
unless $node->isPINode 0 0 0
579 0 ▶ if( my $val = $self->{literal}->value )
Branch: 1 branch
BranchTrueFalseTotal
if (my $val = $self->{'literal'}->value) { } 0 0 0
580 {
581 0 ▶ return(1) if( $node->getTarget eq $val );
Branch: 1 branch
BranchTrueFalseTotal
if $node->getTarget eq $val 0 0 0
582 }
583 else
584 {
585 0 return(1);
586 }
587 }
588 # fallthrough returns false
589 748 return;
590 }
591  
592 7 ▶sub test { return( shift->_set_get_scalar( 'test', @_ ) ); }
Subroutine test: called CC=1 SCAR=0.0
Pod documented
593  
594 sub test_attribute
595 {
596 433 ▶ my $self = shift( @_ );
Subroutine test_attribute: called CC=10 SCAR=29.6
Pod documented
597 433 my $node = shift( @_ );
598 433 my $test = $self->{test};
599 433 ▶ return(1) if( ( $test == TEST_ATTR_ANY ) || ( $test == TEST_NT_NODE ) );
Branch: 1 branch
BranchTrueFalseTotal
if $test == 5 or $test == 9 76 357 433
Condition66%2/3
$test == 5 or $test == 9
l!l&&r!l&&!r
760357
MC/DC50%1/2
$test == 5 or $test == 9
$test == 5 $test == 9
Truth table66%2/3
A or B
A= $test == 5B= $test == 9
ABresult
1X1
011
000
600  
601 357 ▶ if( $test == TEST_ATTR_NCWILD )
Branch: 2 branches
BranchTrueFalseTotal
if ($test == 4) { } 0 357 357
elsif ($test == 3) { } 357 0 357
602 {
603 0 ▶ return(1) if( $self->_match_ns( $node ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_match_ns($node) 0 0 0
604 }
605 elsif( $test == TEST_ATTR_QNAME )
606 {
607 357 ▶ if( $self->{literal} =~ /:/ )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'literal'} =~ /:/) { } 0 357 357
608 {
609 0 my( $prefix, $name ) = _name2prefix_and_local_name( $self->{literal} );
610 0 ▶ return(1) if( ( $name eq $node->getLocalName ) && ( $self->_match_ns( $node ) ) );
Branch: 1 branch
BranchTrueFalseTotal
if $name eq $node->getLocalName and $self->_match_ns($node) 0 0 0
Condition0%0/3
$name eq $node->getLocalName and $self->_match_ns($node)
!ll&&!rl&&r
000
MC/DC0%0/2
$name eq $node->getLocalName and $self->_match_ns($node)
$name eq $node->getLocalName $self->_match_ns($node)
Truth table0%0/3
A and B
A= $name eq $node->getLocalNameB= $self->_match_ns($node)
ABresult
0X0
100
111
611 }
612 else
613 {
614 357 ▶ return(1) if( $node->getName eq $self->{literal} );
Branch: 1 branch
BranchTrueFalseTotal
if $node->getName eq $self->{"literal"} 111 246 357
615 }
616 }
617 # fallthrough returns false
618 246 return;
619 }
620  
621 sub test_namespace
622 {
623 0 ▶ my $self = shift( @_ );
Subroutine test_namespace: not called CC=4 SCAR=30.0
Pod documented
624 0 my $node = shift( @_ );
625 # Not sure if this is correct. The spec seems very unclear on what
626 # constitutes a namespace test... bah!
627 0 my $test = $self->{test};
628 # True for all nodes of principal type
629 0 ▶ return(1) if( $test == TEST_ANY );
Branch: 1 branch
BranchTrueFalseTotal
if $test == 2 0 0 0
630
631 0 ▶ if( $test == TEST_ANY )
Branch: 2 branches
BranchTrueFalseTotal
if ($test == 2) { } 0 0 0
elsif ($self->{'literal'} eq $node->getExpanded) { } 0 0 0
632 {
633 0 return(1);
634 }
635 elsif( $self->{literal} eq $node->getExpanded )
636 {
637 0 return(1);
638 }
639 0 return;
640 }
641  
642 sub _class_for
643 {
644 1670 ▶ my( $self, $mod ) = @_;
Subroutine _class_for: called CC=3 SCAR=11.3
645 1670 eval( "require ${BASE_CLASS}\::${mod};" );
646 1670 ▶ die( $@ ) if( $@ );
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 1670 1670
647 # ${"${BASE_CLASS}\::${mod}\::DEBUG"} = $DEBUG;
648 1670 ▶ eval( "\$${BASE_CLASS}\::${mod}\::DEBUG = " . ( $DEBUG // 0 ) );
Condition50%1/2
$HTML::Object::XPath::Step::DEBUG // 0
l!l
16700
MC/DC0%0/1
$HTML::Object::XPath::Step::DEBUG // 0
$HTML::Object::XPath::Step::DEBUG
Truth table50%1/2
A
A= $HTML::Object::XPath::Step::DEBUG
Aresult
11
00
649 1670 return( "${BASE_CLASS}::${mod}" );
650 }
651  
652 sub _match_ns
653 {
654 0 ▶ my( $self, $node ) = @_;
Subroutine _match_ns: not called CC=5 SCAR=34.0
655 0 my $pp = $self->{pp};
656 0 my $prefix = _name2prefix( $self->{literal} );
657 0 my( $match_ns, $node_ns );
658 0 ▶ if( $pp->{uses_namespaces} || $pp->{strict_namespaces} )
Branch: 1 branch
BranchTrueFalseTotal
if ($pp->{'uses_namespaces'} or $pp->{'strict_namespaces'}) { } 0 0 0
Condition0%0/3
$pp->{"uses_namespaces"} or $pp->{"strict_namespaces"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$pp->{"uses_namespaces"} or $pp->{"strict_namespaces"}
$pp->{"uses_namespaces"} $pp->{"strict_namespaces"}
Truth table0%0/3
A or B
A= $pp->{"uses_namespaces"}B= $pp->{"strict_namespaces"}
ABresult
1X1
011
000
659 {
660 0 $match_ns = $pp->get_namespace( $prefix );
661 0 ▶ if( $match_ns || $pp->{strict_namespaces} )
Branch: 1 branch
BranchTrueFalseTotal
if ($match_ns or $pp->{'strict_namespaces'}) { } 0 0 0
Condition0%0/3
$match_ns or $pp->{"strict_namespaces"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$match_ns or $pp->{"strict_namespaces"}
$match_ns $pp->{"strict_namespaces"}
Truth table0%0/3
A or B
A= $match_nsB= $pp->{"strict_namespaces"}
ABresult
1X1
011
000
662 {
663 0 $node_ns = $node->getNamespace->getValue;
664 }
665 # non-standard behaviour: if the query prefix is not declared
666 # compare the 2 prefixes
667 else
668 {
669 0 $match_ns = $prefix;
670 0 $node_ns = _name2prefix( $node->getName );
671 }
672 }
673 else
674 {
675 0 $match_ns = $prefix;
676 0 $node_ns = _name2prefix( $node->getName );
677 }
678 0 return( $match_ns eq $node_ns );
679 }
680  
681 sub _name2prefix
682 {
683 0 ▶ my $name = shift( @_ );
Subroutine _name2prefix: not called CC=2 SCAR=17.9
684 0 ▶ if( $name =~ m{^(.*?):} )
Branch: 1 branch
BranchTrueFalseTotal
if ($name =~ /^(.*?):/) { } 0 0 0
685 {
686 0 return( $1 );
687 }
688 else
689 {
690 0 return( '' );
691 }
692 }
693  
694 sub _name2prefix_and_local_name
695 {
696 0 ▶ my $name = shift( @_ );
Subroutine _name2prefix_and_local_name: not called CC=2 SCAR=17.9
697 0 ▶ return( $name =~ /:/ ? split( ':', $name, 2 ) : ( '', $name ) );
Branch: 1 branch
BranchTrueFalseTotal
$name =~ /:/ ? : 0 0 0
698 }
699  
700 sub _next_sibling_of_an_ancestor_of
701 {
702 10 ▶ my $elt = shift( @_ );
Subroutine _next_sibling_of_an_ancestor_of: called CC=5 SCAR=16.2
703 # NOTE: return 0 instead of undef ?
704 10 ▶ $elt = $elt->getParentNode || return;
Condition50%1/2
$elt->getParentNode || (return)
l!l
100
MC/DC0%0/1
$elt->getParentNode || (return)
$elt->getParentNode
Truth table50%1/2
A
A= $elt->getParentNode
Aresult
11
00
705 10 my $next_elt;
706 10 ▶ while( !( $next_elt= $elt->getNextSibling ) )
Branch: 1 branch
BranchTrueFalseTotal
unless ($next_elt = $elt->getNextSibling) 15 5 20
707 {
708 15 $elt= $elt->getParentNode;
709 15 ▶ return unless( $elt && $elt->can( 'getNextSibling' ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $elt and $elt->can("getNextSibling") 5 10 15
Condition66%2/3
$elt and $elt->can("getNextSibling")
!ll&&!rl&&r
5010
MC/DC50%1/2
$elt and $elt->can("getNextSibling")
$elt $elt->can("getNextSibling")
Truth table66%2/3
A and B
A= $eltB= $elt->can("getNextSibling")
ABresult
0X0
100
111
710 }
711 5 return( $next_elt );
712 }
713  
714 sub _previous_sibling_of_an_ancestor_of
715 {
716 6 ▶ my $elt = shift( @_ );
Subroutine _previous_sibling_of_an_ancestor_of: called CC=4 SCAR=13.9
717 # NOTE: Should we return 0 instead of undef ?
718 6 ▶ $elt = $elt->getParentNode || return;
Condition50%1/2
$elt->getParentNode || (return)
l!l
60
MC/DC0%0/1
$elt->getParentNode || (return)
$elt->getParentNode
Truth table50%1/2
A
A= $elt->getParentNode
Aresult
11
00
719 6 my $next_elt;
720 6 ▶ while( !( $next_elt = $elt->getPreviousSibling ) )
Branch: 1 branch
BranchTrueFalseTotal
unless ($next_elt = $elt->getPreviousSibling) 6 3 9
721 {
722 6 $elt = $elt->getParentNode;
723 # so we do not have to write a getPreviousSibling
724 6 ▶ return unless( $elt->getParentNode );
Branch: 1 branch
BranchTrueFalseTotal
unless $elt->getParentNode 3 3 6
725 }
726 3 return( $next_elt );
727 }
728  
729 12 1;
730 # NOTE: POD
731 __END__
732  
733 =encoding utf-8
734  
735 =head1 NAME
736  
737 HTML::Object::XPath::Step - HTML Object XPath Step
738  
739 =head1 SYNOPSIS
740  
741 use HTML::Object::XPath::Step;
742 my $this = HTML::Object::XPath::Step->new || die( HTML::Object::XPath::Step->error, "\n" );
743  
744 =head1 VERSION
745  
746 v0.2.0
747  
748 =head1 DESCRIPTION
749  
750 This module represents a XPath step.
751  
752 =head1 CONSTRUCTOR
753  
754 =head2 new
755  
756 It takes a L<HTML::Object::XPath> object, an C<axis>, a C<test> name and a C<literal> and returns a new L<HTML::Object::XPath::Step> object.
757  
758 =head1 METHODS
759  
760 =head2 as_string
761  
762 Returns a string representation of the step.
763  
764 =head2 as_xml
765  
766 Returns a string representation of the step as xml.
767  
768 =head2 axis
769  
770 Set or get the axis.
771  
772 =head2 axis_ancestor
773  
774 Provided with a L<context|HTML::Object::Element> and a L<HTML::Object::XPath::NodeSet> object, and this will add each parent until there are none found anymore, to the resulting node set and returns it.
775  
776 =head2 axis_ancestor_or_self
777  
778 This performs a similar function as L</axis_ancestor>, except it test each node and add it to the result, before going up to the next parent.
779  
780 =head2 axis_attribute
781  
782 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will add each of its attribute object to the resulting node set and returns it.
783  
784 =head2 axis_child
785  
786 Provided with a L<context|HTML::Object::Element> and a L<HTML::Object::XPath::NodeSet> object, and this will add each of the children's node and returns the resulting set.
787  
788 =head2 axis_descendant
789  
790 Provided with a L<context|HTML::Object::Element> and a L<HTML::Object::XPath::NodeSet> object, and this will add each of the children's node and its children after that until there is none and returns the resulting set.
791  
792 =head2 axis_descendant_or_self
793  
794 This performs a similar function as L</axis_ancestor>, except it test each node and add it to the result, before going down to the next children's nodes.
795  
796 =head2 axis_following
797  
798 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will get all the first child in the tree of the element's next sibling.
799  
800 =head2 axis_following_sibling
801  
802 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will add its next sibling to the resulting node set and its sibling sibling and so forth. It returns the resulting node set.
803  
804 =head2 axis_method
805  
806 Set or get the axis method.
807  
808 =head2 axis_namespace
809  
810 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will add each namespace of the C<context> into the result.
811  
812 =head2 axis_parent
813  
814 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will psh to the result array the context's parent, if any. It returns the resulting node set.
815  
816 =head2 axis_preceding
817  
818 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will get all the last child of the previous sibling hierarchy. It returns the resulting node set.
819  
820 =head2 axis_preceding_sibling
821  
822 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will all the previous siblings recursively. It returns the resulting node set.
823  
824 =head2 axis_self
825  
826 Provided with a L<context|HTML::Object::Element> and a L<node set|HTML::Object::XPath::NodeSet> and this will return the node set with the provided C<context> added to it.
827  
828 =head2 evaluate
829  
830 Provided with a L<node set|HTML::Object::XPath::NodeSet> or a L<node|HTML::Object::Element> and this will evaluate each element of the nod set by calling L</evaluate_node> for each of them and adding the result to a new node set and returns it.
831  
832 =head2 evaluate_node
833  
834 Provided with a L<context|HTML::Object::Element> and this will evaluate the context, by calling the method set in L</axis_method> and passing it the C<context> and a new L<node set|HTML::Object::XPath::NodeSet>. It returns the new node set.
835  
836 =head2 filter_by_predicate
837  
838 Provided with a L<node set|HTML::Object::XPath::NodeSet> and a predicate and this will evaluate each element in the node set with the predicate. Based on the result, it will add the node evaluated to a new node set that is returned.
839  
840 =head2 literal
841  
842 Set or get the literal value.
843  
844 =head2 new_nodeset
845  
846 Returns a new L<node set object|HTML::Object::XPath::NodeSet> passing it whatever arguments was provided.
847  
848 =head2 node_test
849  
850 Provided with a L<node|HTML::Object::Element> and this will test it based on the test set for this step and return a certain value; most of the time a simple true value.
851  
852 =head2 test
853  
854 Set or get the test name (or actually number) to be performed.
855  
856 =head2 test_attribute
857  
858 Provided with a L<node|HTML::Object::Element> and this will test its attribute.
859  
860 =head2 test_namespace
861  
862 Provided with a L<node|HTML::Object::Element> and this will test its name space.
863  
864 =head1 AUTHOR
865  
866 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
867  
868 =head1 SEE ALSO
869  
870 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>
871  
872 =head1 COPYRIGHT & LICENSE
873  
874 Copyright(c) 2021 DEGUEST Pte. Ltd.
875  
876 All rights reserved
877  
878 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
879  
880 =cut
« lib/HTML/Object/DOM/File.pm ↑ Summary lib/HTML/Object/DOM/Element/Table.pm »