| 1 | package XML::XSS::Document; | ||||||||||||
| 2 | 15 | our $AUTHORITY = 'cpan:YANICK'; | |||||||||||
| 3 | # ABSTRACT: XML::XSS document stylesheet rule | ||||||||||||
| 4 | 15 | $XML::XSS::Document::VERSION = '0.3.5'; | |||||||||||
| 5 | |||||||||||||
| 6 | 15 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 15 | ▶ | use MooseX::SemiAffordanceAccessor; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 15 | ▶ | use MooseX::Clone; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 15 | with 'XML::XSS::Role::Renderer', 'MooseX::Clone'; | |||||||||||
| 11 | |||||||||||||
| 12 | 15 | ▶ | no warnings qw/ uninitialized /; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | |||||||||||||
| 15 | 15 | has use_clean_stash => ( | |||||||||||
| 16 | default => 1, | ||||||||||||
| 17 | is => 'rw', | ||||||||||||
| 18 | traits => [ 'Clone' ], | ||||||||||||
| 19 | ); | ||||||||||||
| 20 | |||||||||||||
| 21 | 15 | has [ qw/ content pre post / ] => ( traits => [ qw/ XML::XSS::Role::StyleAttribute | |||||||||||
| 22 | Clone / ] ); | ||||||||||||
| 23 | |||||||||||||
| 24 | |||||||||||||
| 25 | 48 | ▶ | sub apply { | ||||||||||
|
Subroutine
apply: called CC=4 SCAR=14.0
| |||||||||||||
| 26 | 48 | my ( $self, $node, $args ) = @_; | |||||||||||
| 27 | 48 | ▶ | $args ||= {}; | ||||||||||
|
Condition50%1/2
$args ||= {}
MC/DC0%0/1
$args ||= {}
$args
Truth table50%1/2
A
A= $args
| |||||||||||||
| 28 | |||||||||||||
| 29 | 48 | ▶ | $self->stylesheet->clear_stash if $self->use_clean_stash; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | |||||||||||||
| 31 | 48 | my $output = $self->_render( 'pre', $node, $args ); | |||||||||||
| 32 | |||||||||||||
| 33 | 48 | ▶ | $output .= $self->has_content | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 34 | ? $self->_render( 'content', $node, $args ) | ||||||||||||
| 35 | : $self->render( $node->childNodes, $args ) | ||||||||||||
| 36 | ; | ||||||||||||
| 37 | |||||||||||||
| 38 | 48 | $output .= $self->_render( 'post', $node, $args ); | |||||||||||
| 39 | |||||||||||||
| 40 | 48 | return $output; | |||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | 15 | 1; | |||||||||||
| 44 | |||||||||||||
| 45 | __END__ | ||||||||||||