DOM2/Element/DocumentType.pm

filter: Statementstmt 73.3% 22 / 30 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 100% 9 / 9 totaltotal 71.1% 42 / 59 CC 5 SCAR 8.1
CC
5
Cov
68%
systemId
6.0
ownerDocument
2.0
publicId
2.0
CRAP 2.3
« DOM2/Attribute.pm ↑ Summary DOM2/DOM/Attribute.pm »
1 package XML::DOM2::Element::DocumentType;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 XML::DOM2::Element::DocumentType - XML DocumentType
9  
10 =head1 DESCRIPTION
11  
12 Provides a DocumentType element for documents
13  
14 =head1 METHODS
15  
16 =cut
17  
18 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 =head2 new
21  
22 Creates a new documentType object
23  
24 Parameters:
25  
26 - name qualified name of the document to be created.
27 - publicid The external subset public identifier.
28 - systemid The external subset system identifier.
29  
30 =cut
31 sub new
32 2 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod documented
33 2 my ($proto, %args) = @_;
34 # croak "name required (qualifiedName) in documentType" if not $args{'name'};
35 # croak "publicid required in documentType" if not $args{'publicid'};
36 2 my $doctype = bless \%args, $proto;
37 2 return $doctype;
38 }
39  
40 =head2 ownerDocument
41  
42 $document = $document->ownerDocument;
43  
44 Returns the document that this type is within, undef if orphaned.
45  
46 =cut
47 sub ownerDocument
48 2 ▶{
Subroutine ownerDocument: called CC=2 SCAR=7.1
Pod documented
49 2 my ($self, $set) = @_;
50 2 ▶ $self->{'document'} = $set if defined($set);
Branch: 1 branch
BranchTrueFalseTotal
if defined $set 2 0 2
51 2 return $self->{'document'};
52 }
53  
54 =head2 name
55  
56 The name of DTD; i.e., the name immediately following the DOCTYPE keyword.
57  
58 =cut
59 sub name
60 22 ▶{
Subroutine name: called CC=2 SCAR=6.9
Pod documented
61 22 my ($self, $set) = @_;
62 22 ▶ $self->{'name'} = $set if defined($set);
Branch: 1 branch
BranchTrueFalseTotal
if defined $set 2 20 22
63 22 return $self->{'name'};
64 }
65  
66 =head2 entities
67  
68 A NamedNodeMap containing the general entities, both external and internal, declared in the DTD. Parameter entities are not contained. Duplicates are discarded.
69  
70 =cut
71 sub entities
72 0 ▶{
Subroutine entities: not called CC=1 SCAR=6.9
Pod documented
73 0 die "Not implimented yet";
74 }
75  
76 =head2 notations
77  
78 Returns a HASH containing the notations declared in the DTD. Duplicates are discarded. Every node in this map also implements the Notation interface.
79  
80 The DOM Level 2 does not support editing notations, therefore notations cannot be altered in any way.
81  
82 =cut
83 sub notations
84 0 ▶{
Subroutine notations: not called CC=1 SCAR=6.9
Pod documented
85 0 die "Not implimented yet";
86 }
87  
88 =head2 publicId
89  
90 Returns the public identifier of the external subset.
91  
92 =cut
93 sub publicId
94 1 ▶{
Subroutine publicId: called CC=2 SCAR=7.1
Pod documented
95 1 my ($self, $set) = @_;
96 1 ▶ $self->{'publicId'} = $set if defined($set);
Branch: 1 branch
BranchTrueFalseTotal
if defined $set 0 1 1
97 1 return $self->{'publicId'};
98 }
99  
100 =head2 systemId
101  
102 Returns the system identifier of the external subset.
103  
104 =cut
105 sub systemId
106 0 ▶{
Subroutine systemId: not called CC=2 SCAR=17.9
Pod documented
107 0 my ($self, $set) = @_;
108 0 ▶ $self->{'systemId'} = $set if defined($set);
Branch: 1 branch
BranchTrueFalseTotal
if defined $set 0 0 0
109 0 return $self->{'systemId'};
110 }
111  
112 =head2 internalSubset
113  
114 The internal subset as a string.
115  
116 Note: The actual content returned depends on how much information is available to the implementation. This may vary depending on various parameters, including the XML processor used to build the document.
117  
118 =cut
119 sub internalSubset
120 0 ▶{
Subroutine internalSubset: not called CC=1 SCAR=6.9
Pod documented
121 0 die "Not implimented yet";
122 }
123  
124 =head2 $documentType->dtd()
125  
126 Returns the document type definition information.
127  
128 =cut
129 sub dtd
130 0 ▶{
Subroutine dtd: not called CC=1 SCAR=6.9
Pod documented
131 0 my ($self) = @_;
132 0 return $self->{'dtd'};
133 }
134  
135 =head1 AUTHOR
136  
137 Martin Owens, doctormo@postmaster.co.uk
138  
139 =head1 SEE ALSO
140  
141 perl(1), L<XML::DOM2>, L<XML::DOM2::Element>, L<XML::DOM2::DOM>
142  
143 L<http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core.html> DOM at the W3C
144  
145 =cut
146  
147 4 return 1;
« DOM2/Attribute.pm ↑ Summary DOM2/DOM/Attribute.pm »