| 1 | # $Id: /mirror/coderepos/lang/perl/MooseX-DOM/trunk/lib/MooseX/DOM/LibXML/ContextNode.pm 68052 2008-08-08T06:27:52.258779Z daisuke $ | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | package MooseX::DOM::LibXML::ContextNode; | ||||||||||||||||||||
| 4 | 1 | ▶ | use Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 1 | ▶ | use Class::Inspector; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use XML::LibXML; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use XML::LibXML::XPathContext; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | has 'node' => ( | ||||||||||||||||||||
| 10 | is => 'rw', | ||||||||||||||||||||
| 11 | isa => 'XML::LibXML::Element', | ||||||||||||||||||||
| 12 | required => 1, | ||||||||||||||||||||
| 13 | handles => [ | ||||||||||||||||||||
| 14 | grep { | ||||||||||||||||||||
| 15 | 147 | ▶ | !/^[0-9A-Z_]+$/ && !/^(?:findnodes|findvalue)$/ } ( | ||||||||||||||||||
|
Condition100%3/3
/^[0-9A-Z_]+$/ || /^(?:findnodes|findvalue)$/
MC/DC100%2/2
/^[0-9A-Z_]+$/ || /^(?:findnodes|findvalue)$/
/^[0-9A-Z_]+$/
/^(?:findnodes|findvalue)$/
Truth table100%3/3
A || B
A= /^[0-9A-Z_]+$/B= /^(?:findnodes|findvalue)$/
| |||||||||||||||||||||
| 16 | 1 | @{ Class::Inspector->methods( 'XML::LibXML::Element', 'public' ) }, | |||||||||||||||||||
| 17 | ) | ||||||||||||||||||||
| 18 | ] | ||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 1 | has 'context' => ( | |||||||||||||||||||
| 22 | is => 'rw', | ||||||||||||||||||||
| 23 | isa => 'XML::LibXML::XPathContext', | ||||||||||||||||||||
| 24 | required => 1, | ||||||||||||||||||||
| 25 | handles => [ qw(findnodes findvalue) ], | ||||||||||||||||||||
| 26 | ); | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 1 | ▶ | no Moose; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 0 | ▶ | sub BUILDARGS { | ||||||||||||||||||
|
Subroutine
BUILDARGS: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||
| 33 | 0 | my ($self, %args) = @_; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | my $xc = XML::LibXML::XPathContext->new($args{node}); | |||||||||||||||||||
| 36 | 0 | ▶ | while (my ($prefix, $uri) = each %{ $args{namespaces} || {} }) { | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$args{'namespaces'} || {}
MC/DC0%0/1
$args{'namespaces'} || {}
$args{'namespaces'}
Truth table0%0/2
A
A= $args{'namespaces'}
| |||||||||||||||||||||
| 37 | 0 | ▶ | next if defined $xc->lookupNs($uri); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 0 | $xc->registerNs($prefix, $uri); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | return { %args, context => $xc }; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 1 | 1; | |||||||||||||||||||