| 1 | package XML::XPathScript::Processor::B; | ||||||||||||||||||||
| 2 | 1 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||||||||||
| 3 | 1 | $XML::XPathScript::Processor::B::VERSION = '2.00'; | |||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use base qw/ XML::XPathScript::Processor /; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | # No namespaces here | ||||||||||||||||||||
| 10 | 0 | ▶ | sub get_namespace { } | ||||||||||||||||||
|
Subroutine
get_namespace: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | ▶ | sub get_child_nodes { $_[1]->get_children } | ||||||||||||||||||
|
Subroutine
get_child_nodes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 0 | ▶ | sub findnodes { | ||||||||||||||||||
|
Subroutine
findnodes: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 15 | 0 | my ( $self, $xpath, $context ) = @_; | |||||||||||||||||||
| 16 | 0 | ▶ | $context ||= $self->{dom}; | ||||||||||||||||||
|
Condition0%0/3
$context ||= $self->{"dom"}
MC/DC0%0/2
$context ||= $self->{"dom"}
$context
$self->{"dom"}
Truth table0%0/3
A ||= B
A= $contextB= $self->{"dom"}
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 0 | return $context->match( $xpath ); | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 0 | ▶ | sub to_string { | ||||||||||||||||||
|
Subroutine
to_string: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 22 | 0 | my ( $self, $node ) = @_; | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | my $string = $self->start_tag( $node ); | |||||||||||||||||||
| 25 | 0 | $string .= $self->to_string( $_ ) for $node->get_children; | |||||||||||||||||||
| 26 | 0 | $string .= $self->end_tag( $node ); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | return $string; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 0 | ▶ | sub get_node_name { $_[1]->get_name } | ||||||||||||||||||
|
Subroutine
get_node_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | ▶ | sub get_qualified_name { $_[1]->get_name } | ||||||||||||||||||
|
Subroutine
get_qualified_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | ▶ | sub get_attributes { | ||||||||||||||||||
|
Subroutine
get_attributes: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 36 | 0 | ▶ | if ( $_[1]->can( 'get_attr_names' ) ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 37 | 0 | return map { ( [ $_ => $_[1]->get_attr_value( $_ ) ] ) | |||||||||||||||||||
| 38 | x !! defined $_[1]->get_attr_value( $_ ) } | ||||||||||||||||||||
| 39 | $_[1]->get_attr_names ; | ||||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | return; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | ▶ | sub get_attribute { " $_[1][0]='$_[1][1]' " } | ||||||||||||||||||
|
Subroutine
get_attribute: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | # it's all element nodes | ||||||||||||||||||||
| 48 | 0 | ▶ | sub is_element_node { 1 } | ||||||||||||||||||
|
Subroutine
is_element_node: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 49 | 0 | ▶ | sub is_nodelist { 0 } | ||||||||||||||||||
|
Subroutine
is_nodelist: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 50 | 0 | ▶ | sub is_text_node { 0 } | ||||||||||||||||||
|
Subroutine
is_text_node: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 51 | 0 | ▶ | sub is_comment_node { 0 } | ||||||||||||||||||
|
Subroutine
is_comment_node: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 52 | 0 | ▶ | sub is_pi_node { 0 } | ||||||||||||||||||
|
Subroutine
is_pi_node: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 1 | 1; | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||