line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package XML::DOM2::Element::DocumentType; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
97
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
80
|
|
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
|
3
|
|
|
3
|
|
17
|
use Carp; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1525
|
|
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
|
|
|
|
|
|
|
{ |
33
|
2
|
|
|
2
|
1
|
13
|
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
|
|
|
|
|
8
|
my $doctype = bless \%args, $proto; |
37
|
2
|
|
|
|
|
9
|
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
|
|
|
|
|
|
|
{ |
49
|
2
|
|
|
2
|
1
|
6
|
my ($self, $set) = @_; |
50
|
2
|
50
|
|
|
|
14
|
$self->{'document'} = $set if defined($set); |
51
|
2
|
|
|
|
|
7
|
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
|
|
|
|
|
|
|
{ |
61
|
22
|
|
|
22
|
1
|
37
|
my ($self, $set) = @_; |
62
|
22
|
100
|
|
|
|
65
|
$self->{'name'} = $set if defined($set); |
63
|
22
|
|
|
|
|
175
|
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
|
|
|
|
|
|
|
{ |
73
|
0
|
|
|
0
|
1
|
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
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
0
|
1
|
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
|
|
|
|
|
|
|
{ |
95
|
1
|
|
|
1
|
1
|
2
|
my ($self, $set) = @_; |
96
|
1
|
50
|
|
|
|
5
|
$self->{'publicId'} = $set if defined($set); |
97
|
1
|
|
|
|
|
6
|
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
|
|
|
|
|
|
|
{ |
107
|
0
|
|
|
0
|
1
|
|
my ($self, $set) = @_; |
108
|
0
|
0
|
|
|
|
|
$self->{'systemId'} = $set if defined($set); |
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
|
|
|
|
|
|
|
{ |
121
|
0
|
|
|
0
|
1
|
|
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
|
|
|
|
|
|
|
{ |
131
|
0
|
|
|
0
|
1
|
|
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, L, L |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
L DOM at the W3C |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
return 1; |