XPath/Node/PI.pm

filter: Statementstmt 48.7% 19 / 39 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod n/a totaltotal 45.2% 24 / 53 CC 1 SCAR 5.0
CC
1
Cov
49%
new
2.0
getNodeType
2.0
isPINode
2.0
CRAP 1.6
« XPath/Node/Comment.pm ↑ Summary XPath/LocationPath.pm »
1 package XML::XPath::Node::PI;
2  
3 1 $VERSION = '1.26';
4  
5 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use vars qw/@ISA/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 @ISA = ('XML::XPath::Node');
9  
10 package XML::XPath::Node::PIImpl;
11  
12 1 ▶use vars qw/@ISA/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 @ISA = ('XML::XPath::NodeImpl', 'XML::XPath::Node::PI');
14 1 ▶use XML::XPath::Node ':node_keys';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 sub new {
17 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
18 0 my ($target, $data) = @_;
19  
20 0 my $pos = XML::XPath::Node->nextPos;
21  
22 0 my @vals;
23 0 @vals[node_global_pos, node_target, node_data] =
24 ($pos, $target, $data);
25 0 my $self = \@vals;
26 0 bless $self, $class;
27 }
28  
29 0 ▶sub getNodeType { PROCESSING_INSTRUCTION_NODE }
Subroutine getNodeType: not called CC=1 SCAR=6.9
30  
31 0 ▶sub isPINode { 1; }
Subroutine isPINode: not called CC=1 SCAR=6.9
32 0 ▶sub isProcessingInstructionNode { 1; }
Subroutine isProcessingInstructionNode: not called CC=1 SCAR=6.9
33  
34 sub getTarget {
35 0 ▶ my $self = shift;
Subroutine getTarget: not called CC=1 SCAR=6.9
36 0 $self->[node_target];
37 }
38  
39 sub getData {
40 0 ▶ my $self = shift;
Subroutine getData: not called CC=1 SCAR=6.9
41 0 $self->[node_data];
42 }
43  
44 sub _to_sax {
45 0 ▶ my $self = shift;
Subroutine _to_sax: not called CC=1 SCAR=6.9
46 0 my ($doch, $dtdh, $enth) = @_;
47 # PI's not supported in PerlSAX 1
48 }
49  
50 sub string_value {
51 0 ▶ my $self = shift;
Subroutine string_value: not called CC=1 SCAR=6.9
52 0 return $self->[node_data];
53 }
54  
55 sub toString {
56 0 ▶ my $self = shift;
Subroutine toString: not called CC=1 SCAR=6.9
57 0 return "<?" . $self->[node_target] . " " . XML::XPath::Node::XMLescape($self->[node_data], ">") . "?>";
58 }
59  
60 1 1;
61 __END__
« XPath/Node/Comment.pm ↑ Summary XPath/LocationPath.pm »