| 1 | package XML::XPath::Node::Text; | ||
| 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::TextImpl; | ||
| 11 | |||
| 12 | 1 | ▶ | use vars qw/@ISA/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 1 | @ISA = ('XML::XPath::NodeImpl', 'XML::XPath::Node::Text'); | |
| 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 ($text) = @_; | |
| 19 | |||
| 20 | 0 | my $pos = XML::XPath::Node->nextPos; | |
| 21 | |||
| 22 | 0 | my @vals; | |
| 23 | 0 | @vals[node_global_pos, node_text] = ($pos, $text); | |
| 24 | 0 | my $self = \@vals; | |
| 25 | |||
| 26 | 0 | bless $self, $class; | |
| 27 | } | ||
| 28 | |||
| 29 | 0 | ▶ | sub getNodeType { TEXT_NODE } |
|
Subroutine
getNodeType: not called CC=1 SCAR=6.9
| |||
| 30 | |||
| 31 | 0 | ▶ | sub isTextNode { 1; } |
|
Subroutine
isTextNode: not called CC=1 SCAR=6.9
| |||
| 32 | |||
| 33 | sub appendText { | ||
| 34 | 0 | ▶ | my $self = shift; |
|
Subroutine
appendText: not called CC=1 SCAR=6.9
| |||
| 35 | 0 | my ($text) = @_; | |
| 36 | 0 | $self->[node_text] .= $text; | |
| 37 | } | ||
| 38 | |||
| 39 | sub getNodeValue { | ||
| 40 | 0 | ▶ | my $self = shift; |
|
Subroutine
getNodeValue: not called CC=1 SCAR=6.9
| |||
| 41 | 0 | $self->[node_text]; | |
| 42 | } | ||
| 43 | |||
| 44 | sub getData { | ||
| 45 | 0 | ▶ | my $self = shift; |
|
Subroutine
getData: not called CC=1 SCAR=6.9
| |||
| 46 | 0 | $self->[node_text]; | |
| 47 | } | ||
| 48 | |||
| 49 | sub setNodeValue { | ||
| 50 | 0 | ▶ | my $self = shift; |
|
Subroutine
setNodeValue: not called CC=1 SCAR=6.9
| |||
| 51 | 0 | $self->[node_text] = shift; | |
| 52 | } | ||
| 53 | |||
| 54 | sub _to_sax { | ||
| 55 | 0 | ▶ | my $self = shift; |
|
Subroutine
_to_sax: not called CC=1 SCAR=6.9
| |||
| 56 | 0 | my ($doch, $dtdh, $enth) = @_; | |
| 57 | |||
| 58 | 0 | $doch->characters( { Data => $self->getValue } ); | |
| 59 | } | ||
| 60 | |||
| 61 | sub string_value { | ||
| 62 | 0 | ▶ | my $self = shift; |
|
Subroutine
string_value: not called CC=1 SCAR=6.9
| |||
| 63 | 0 | $self->[node_text]; | |
| 64 | } | ||
| 65 | |||
| 66 | sub toString { | ||
| 67 | 0 | ▶ | my $self = shift; |
|
Subroutine
toString: not called CC=1 SCAR=6.9
| |||
| 68 | 0 | XML::XPath::Node::XMLescape($self->[node_text], "<&"); | |
| 69 | } | ||
| 70 | |||
| 71 | 1 | 1; | |
| 72 | __END__ | ||