| 1 | package XML::DOM2::Element::Document; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | XML::DOM2::Element::Document | ||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | Provides the document element objec with the required DOM | ||||||||||||||||||||||||||||||||||||||||||
| 10 | interface for document wide element requests. | ||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | =head1 METHODS | ||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | ▶ | use base "XML::DOM2::Element"; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | =head2 $class->new( %arguments ) | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | Create a new document object. | ||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 24 | sub new | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 2 | my ($proto, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | confess "Unable to create a new document element with no document!" if not $args{'document'}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 2 | my $doc = $proto->SUPER::new($args{'documentTag'}, %args); | |||||||||||||||||||||||||||||||||||||||||
| 29 | 2 | return $doc; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | =head2 $element->_attribute_handle( $name, %arguments ) | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | Handle document attributes | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 37 | sub _attribute_handle | ||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_attribute_handle: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | my ($self, $name, %opts) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my $ns = $opts{'namespace'}; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if($name eq 'xmlns' or ($ns and $ns->ns_prefix eq 'xmlns')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$name eq "xmlns" or $ns and $ns->ns_prefix eq "xmlns"
$ns and $ns->ns_prefix eq "xmlns"
MC/DC0%0/3
$name eq "xmlns" or $ns and $ns->ns_prefix eq "xmlns"
$name eq "xmlns"
$ns
$ns->ns_prefix eq "xmlns"
Truth table0%0/4
A or B and C
A= $name eq "xmlns"B= $nsC= $ns->ns_prefix eq "xmlns"
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | return XML::DOM2::Attribute::Namespace->new( %opts ); | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | return $self->SUPER::_attribute_handle($name, %opts); | |||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | Martin Owens, doctormo@postmaster.co.uk | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | perl(1), L<XML::DOM2>, L<XML::DOM2::Element>, L<XML::DOM2::DOM> | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | L<http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html> DOM at the W3C | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 4 | return 1; | |||||||||||||||||||||||||||||||||||||||||