line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
2
|
|
|
|
|
|
|
# $Id: Common.pm,v 1.5 2003/02/27 18:32:59 phish108 Exp $ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This is free software, you may use it and distribute it under the same terms as |
6
|
|
|
|
|
|
|
# Perl itself. |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright 2001-2003 AxKit.com Ltd., 2002-2006 Christian Glahn, 2006-2009 Petr Pajas |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
12
|
|
|
|
|
|
|
package XML::LibXML::Common; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
16
|
|
|
|
|
|
|
# global blur # |
17
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
18
|
10
|
|
|
10
|
|
333842
|
use strict; |
|
10
|
|
|
|
|
54
|
|
|
10
|
|
|
|
|
313
|
|
19
|
10
|
|
|
10
|
|
64
|
use warnings; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
371
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
require Exporter; |
22
|
10
|
|
|
10
|
|
53
|
use vars qw( @ISA $VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS); |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
995
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$VERSION = "2.0209"; # VERSION TEMPLATE: DO NOT CHANGE |
27
|
|
|
|
|
|
|
|
28
|
10
|
|
|
10
|
|
2069
|
use XML::LibXML qw(:libxml); |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
58
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
31
|
|
|
|
|
|
|
# export information # |
32
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
33
|
|
|
|
|
|
|
%EXPORT_TAGS = ( |
34
|
|
|
|
|
|
|
all => [qw( |
35
|
|
|
|
|
|
|
ELEMENT_NODE |
36
|
|
|
|
|
|
|
ATTRIBUTE_NODE |
37
|
|
|
|
|
|
|
TEXT_NODE |
38
|
|
|
|
|
|
|
CDATA_SECTION_NODE |
39
|
|
|
|
|
|
|
ENTITY_REFERENCE_NODE |
40
|
|
|
|
|
|
|
ENTITY_NODE |
41
|
|
|
|
|
|
|
PI_NODE |
42
|
|
|
|
|
|
|
PROCESSING_INSTRUCTION_NODE |
43
|
|
|
|
|
|
|
COMMENT_NODE |
44
|
|
|
|
|
|
|
DOCUMENT_NODE |
45
|
|
|
|
|
|
|
DOCUMENT_TYPE_NODE |
46
|
|
|
|
|
|
|
DOCUMENT_FRAG_NODE |
47
|
|
|
|
|
|
|
DOCUMENT_FRAGMENT_NODE |
48
|
|
|
|
|
|
|
NOTATION_NODE |
49
|
|
|
|
|
|
|
HTML_DOCUMENT_NODE |
50
|
|
|
|
|
|
|
DTD_NODE |
51
|
|
|
|
|
|
|
ELEMENT_DECLARATION |
52
|
|
|
|
|
|
|
ATTRIBUTE_DECLARATION |
53
|
|
|
|
|
|
|
ENTITY_DECLARATION |
54
|
|
|
|
|
|
|
NAMESPACE_DECLARATION |
55
|
|
|
|
|
|
|
XINCLUDE_END |
56
|
|
|
|
|
|
|
XINCLUDE_START |
57
|
|
|
|
|
|
|
encodeToUTF8 |
58
|
|
|
|
|
|
|
decodeFromUTF8 |
59
|
|
|
|
|
|
|
)], |
60
|
|
|
|
|
|
|
w3c => [qw( |
61
|
|
|
|
|
|
|
ELEMENT_NODE |
62
|
|
|
|
|
|
|
ATTRIBUTE_NODE |
63
|
|
|
|
|
|
|
TEXT_NODE |
64
|
|
|
|
|
|
|
CDATA_SECTION_NODE |
65
|
|
|
|
|
|
|
ENTITY_REFERENCE_NODE |
66
|
|
|
|
|
|
|
ENTITY_NODE |
67
|
|
|
|
|
|
|
PI_NODE |
68
|
|
|
|
|
|
|
PROCESSING_INSTRUCTION_NODE |
69
|
|
|
|
|
|
|
COMMENT_NODE |
70
|
|
|
|
|
|
|
DOCUMENT_NODE |
71
|
|
|
|
|
|
|
DOCUMENT_TYPE_NODE |
72
|
|
|
|
|
|
|
DOCUMENT_FRAG_NODE |
73
|
|
|
|
|
|
|
DOCUMENT_FRAGMENT_NODE |
74
|
|
|
|
|
|
|
NOTATION_NODE |
75
|
|
|
|
|
|
|
HTML_DOCUMENT_NODE |
76
|
|
|
|
|
|
|
DTD_NODE |
77
|
|
|
|
|
|
|
ELEMENT_DECLARATION |
78
|
|
|
|
|
|
|
ATTRIBUTE_DECLARATION |
79
|
|
|
|
|
|
|
ENTITY_DECLARATION |
80
|
|
|
|
|
|
|
NAMESPACE_DECLARATION |
81
|
|
|
|
|
|
|
XINCLUDE_END |
82
|
|
|
|
|
|
|
XINCLUDE_START |
83
|
|
|
|
|
|
|
)], |
84
|
|
|
|
|
|
|
libxml => [qw( |
85
|
|
|
|
|
|
|
XML_ELEMENT_NODE |
86
|
|
|
|
|
|
|
XML_ATTRIBUTE_NODE |
87
|
|
|
|
|
|
|
XML_TEXT_NODE |
88
|
|
|
|
|
|
|
XML_CDATA_SECTION_NODE |
89
|
|
|
|
|
|
|
XML_ENTITY_REF_NODE |
90
|
|
|
|
|
|
|
XML_ENTITY_NODE |
91
|
|
|
|
|
|
|
XML_PI_NODE |
92
|
|
|
|
|
|
|
XML_COMMENT_NODE |
93
|
|
|
|
|
|
|
XML_DOCUMENT_NODE |
94
|
|
|
|
|
|
|
XML_DOCUMENT_TYPE_NODE |
95
|
|
|
|
|
|
|
XML_DOCUMENT_FRAG_NODE |
96
|
|
|
|
|
|
|
XML_NOTATION_NODE |
97
|
|
|
|
|
|
|
XML_HTML_DOCUMENT_NODE |
98
|
|
|
|
|
|
|
XML_DTD_NODE |
99
|
|
|
|
|
|
|
XML_ELEMENT_DECL |
100
|
|
|
|
|
|
|
XML_ATTRIBUTE_DECL |
101
|
|
|
|
|
|
|
XML_ENTITY_DECL |
102
|
|
|
|
|
|
|
XML_NAMESPACE_DECL |
103
|
|
|
|
|
|
|
XML_XINCLUDE_END |
104
|
|
|
|
|
|
|
XML_XINCLUDE_START |
105
|
|
|
|
|
|
|
)], |
106
|
|
|
|
|
|
|
gdome => [qw( |
107
|
|
|
|
|
|
|
GDOME_ELEMENT_NODE |
108
|
|
|
|
|
|
|
GDOME_ATTRIBUTE_NODE |
109
|
|
|
|
|
|
|
GDOME_TEXT_NODE |
110
|
|
|
|
|
|
|
GDOME_CDATA_SECTION_NODE |
111
|
|
|
|
|
|
|
GDOME_ENTITY_REF_NODE |
112
|
|
|
|
|
|
|
GDOME_ENTITY_NODE |
113
|
|
|
|
|
|
|
GDOME_PI_NODE |
114
|
|
|
|
|
|
|
GDOME_COMMENT_NODE |
115
|
|
|
|
|
|
|
GDOME_DOCUMENT_NODE |
116
|
|
|
|
|
|
|
GDOME_DOCUMENT_TYPE_NODE |
117
|
|
|
|
|
|
|
GDOME_DOCUMENT_FRAG_NODE |
118
|
|
|
|
|
|
|
GDOME_NOTATION_NODE |
119
|
|
|
|
|
|
|
GDOME_HTML_DOCUMENT_NODE |
120
|
|
|
|
|
|
|
GDOME_DTD_NODE |
121
|
|
|
|
|
|
|
GDOME_ELEMENT_DECL |
122
|
|
|
|
|
|
|
GDOME_ATTRIBUTE_DECL |
123
|
|
|
|
|
|
|
GDOME_ENTITY_DECL |
124
|
|
|
|
|
|
|
GDOME_NAMESPACE_DECL |
125
|
|
|
|
|
|
|
GDOME_XINCLUDE_END |
126
|
|
|
|
|
|
|
GDOME_XINCLUDE_START |
127
|
|
|
|
|
|
|
)], |
128
|
|
|
|
|
|
|
encoding => [qw( |
129
|
|
|
|
|
|
|
encodeToUTF8 |
130
|
|
|
|
|
|
|
decodeFromUTF8 |
131
|
|
|
|
|
|
|
)], |
132
|
|
|
|
|
|
|
); |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
@EXPORT_OK = ( |
135
|
|
|
|
|
|
|
@{$EXPORT_TAGS{encoding}}, |
136
|
|
|
|
|
|
|
@{$EXPORT_TAGS{w3c}}, |
137
|
|
|
|
|
|
|
@{$EXPORT_TAGS{libxml}}, |
138
|
|
|
|
|
|
|
@{$EXPORT_TAGS{gdome}}, |
139
|
|
|
|
|
|
|
); |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
@EXPORT = ( |
142
|
|
|
|
|
|
|
@{$EXPORT_TAGS{encoding}}, |
143
|
|
|
|
|
|
|
@{$EXPORT_TAGS{w3c}}, |
144
|
|
|
|
|
|
|
); |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
147
|
|
|
|
|
|
|
# W3 conform node types # |
148
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
149
|
10
|
|
|
10
|
|
82
|
use constant ELEMENT_NODE => 1; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
709
|
|
150
|
10
|
|
|
10
|
|
71
|
use constant ATTRIBUTE_NODE => 2; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
544
|
|
151
|
10
|
|
|
10
|
|
70
|
use constant TEXT_NODE => 3; |
|
10
|
|
|
|
|
48
|
|
|
10
|
|
|
|
|
529
|
|
152
|
10
|
|
|
10
|
|
69
|
use constant CDATA_SECTION_NODE => 4; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
568
|
|
153
|
10
|
|
|
10
|
|
65
|
use constant ENTITY_REFERENCE_NODE => 5; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
476
|
|
154
|
10
|
|
|
10
|
|
57
|
use constant ENTITY_NODE => 6; |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
557
|
|
155
|
10
|
|
|
10
|
|
102
|
use constant PROCESSING_INSTRUCTION_NODE => 7; |
|
10
|
|
|
|
|
39
|
|
|
10
|
|
|
|
|
551
|
|
156
|
10
|
|
|
10
|
|
69
|
use constant COMMENT_NODE => 8; |
|
10
|
|
|
|
|
38
|
|
|
10
|
|
|
|
|
465
|
|
157
|
10
|
|
|
10
|
|
62
|
use constant DOCUMENT_NODE => 9; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
511
|
|
158
|
10
|
|
|
10
|
|
63
|
use constant DOCUMENT_TYPE_NODE => 10; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
530
|
|
159
|
10
|
|
|
10
|
|
69
|
use constant DOCUMENT_FRAGMENT_NODE => 11; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
509
|
|
160
|
10
|
|
|
10
|
|
60
|
use constant NOTATION_NODE => 12; |
|
10
|
|
|
|
|
28
|
|
|
10
|
|
|
|
|
530
|
|
161
|
10
|
|
|
10
|
|
64
|
use constant HTML_DOCUMENT_NODE => 13; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
433
|
|
162
|
10
|
|
|
10
|
|
55
|
use constant DTD_NODE => 14; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
519
|
|
163
|
10
|
|
|
10
|
|
70
|
use constant ELEMENT_DECLARATION => 15; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
583
|
|
164
|
10
|
|
|
10
|
|
78
|
use constant ATTRIBUTE_DECLARATION => 16; |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
492
|
|
165
|
10
|
|
|
10
|
|
63
|
use constant ENTITY_DECLARATION => 17; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
521
|
|
166
|
10
|
|
|
10
|
|
65
|
use constant NAMESPACE_DECLARATION => 18; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
469
|
|
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
169
|
|
|
|
|
|
|
# some extras for the W3 spec |
170
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
171
|
10
|
|
|
10
|
|
60
|
use constant PI_NODE => 7; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
560
|
|
172
|
10
|
|
|
10
|
|
72
|
use constant DOCUMENT_FRAG_NODE => 11; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
504
|
|
173
|
10
|
|
|
10
|
|
59
|
use constant XINCLUDE_END => 19; |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
481
|
|
174
|
10
|
|
|
10
|
|
77
|
use constant XINCLUDE_START => 20; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
610
|
|
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
177
|
|
|
|
|
|
|
# libgdome compat names # |
178
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
179
|
10
|
|
|
10
|
|
82
|
use constant GDOME_ELEMENT_NODE => 1; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
489
|
|
180
|
10
|
|
|
10
|
|
60
|
use constant GDOME_ATTRIBUTE_NODE => 2; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
576
|
|
181
|
10
|
|
|
10
|
|
65
|
use constant GDOME_TEXT_NODE => 3; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
544
|
|
182
|
10
|
|
|
10
|
|
70
|
use constant GDOME_CDATA_SECTION_NODE => 4; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
568
|
|
183
|
10
|
|
|
10
|
|
66
|
use constant GDOME_ENTITY_REF_NODE => 5; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
489
|
|
184
|
10
|
|
|
10
|
|
66
|
use constant GDOME_ENTITY_NODE => 6; |
|
10
|
|
|
|
|
27
|
|
|
10
|
|
|
|
|
490
|
|
185
|
10
|
|
|
10
|
|
62
|
use constant GDOME_PI_NODE => 7; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
488
|
|
186
|
10
|
|
|
10
|
|
63
|
use constant GDOME_COMMENT_NODE => 8; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
541
|
|
187
|
10
|
|
|
10
|
|
70
|
use constant GDOME_DOCUMENT_NODE => 9; |
|
10
|
|
|
|
|
47
|
|
|
10
|
|
|
|
|
542
|
|
188
|
10
|
|
|
10
|
|
68
|
use constant GDOME_DOCUMENT_TYPE_NODE => 10; |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
522
|
|
189
|
10
|
|
|
10
|
|
62
|
use constant GDOME_DOCUMENT_FRAG_NODE => 11; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
492
|
|
190
|
10
|
|
|
10
|
|
60
|
use constant GDOME_NOTATION_NODE => 12; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
523
|
|
191
|
10
|
|
|
10
|
|
58
|
use constant GDOME_HTML_DOCUMENT_NODE => 13; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
547
|
|
192
|
10
|
|
|
10
|
|
63
|
use constant GDOME_DTD_NODE => 14; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
631
|
|
193
|
10
|
|
|
10
|
|
65
|
use constant GDOME_ELEMENT_DECL => 15; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
704
|
|
194
|
10
|
|
|
10
|
|
66
|
use constant GDOME_ATTRIBUTE_DECL => 16; |
|
10
|
|
|
|
|
29
|
|
|
10
|
|
|
|
|
562
|
|
195
|
10
|
|
|
10
|
|
114
|
use constant GDOME_ENTITY_DECL => 17; |
|
10
|
|
|
|
|
44
|
|
|
10
|
|
|
|
|
628
|
|
196
|
10
|
|
|
10
|
|
88
|
use constant GDOME_NAMESPACE_DECL => 18; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
575
|
|
197
|
10
|
|
|
10
|
|
68
|
use constant GDOME_XINCLUDE_START => 19; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
547
|
|
198
|
10
|
|
|
10
|
|
60
|
use constant GDOME_XINCLUDE_END => 20; |
|
10
|
|
|
|
|
37
|
|
|
10
|
|
|
|
|
786
|
|
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
1; |
201
|
|
|
|
|
|
|
#-------------------------------------------------------------------------# |
202
|
|
|
|
|
|
|
__END__ |