line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Excel::Writer::XLSX::Package::ContentTypes; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Excel::Writer::XLSX::Package::ContentTypes - A class for writing the Excel |
6
|
|
|
|
|
|
|
# XLS [Content_Types] file. |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Used in conjunction with Excel::Writer::XLSX |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Copyright 2000-2019, John McNamara, jmcnamara@cpan.org |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# Documentation after __END__ |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# perltidy with the following options: -mbl=2 -pt=0 -nola |
16
|
|
|
|
|
|
|
|
17
|
1040
|
|
|
1040
|
|
17926
|
use 5.008002; |
|
1040
|
|
|
|
|
3798
|
|
18
|
1040
|
|
|
1040
|
|
8285
|
use strict; |
|
1040
|
|
|
|
|
2263
|
|
|
1040
|
|
|
|
|
24818
|
|
19
|
1040
|
|
|
1040
|
|
5143
|
use warnings; |
|
1040
|
|
|
|
|
3471
|
|
|
1040
|
|
|
|
|
26307
|
|
20
|
1040
|
|
|
1040
|
|
7805
|
use Carp; |
|
1040
|
|
|
|
|
3573
|
|
|
1040
|
|
|
|
|
55586
|
|
21
|
1040
|
|
|
1040
|
|
9717
|
use Excel::Writer::XLSX::Package::XMLwriter; |
|
1040
|
|
|
|
|
2604
|
|
|
1040
|
|
|
|
|
1256155
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our @ISA = qw(Excel::Writer::XLSX::Package::XMLwriter); |
24
|
|
|
|
|
|
|
our $VERSION = '1.03'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
############################################################################### |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
# Package data. |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
############################################################################### |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $app_package = 'application/vnd.openxmlformats-package.'; |
34
|
|
|
|
|
|
|
my $app_document = 'application/vnd.openxmlformats-officedocument.'; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
our @defaults = ( |
37
|
|
|
|
|
|
|
[ 'rels', $app_package . 'relationships+xml' ], |
38
|
|
|
|
|
|
|
[ 'xml', 'application/xml' ], |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
our @overrides = ( |
42
|
|
|
|
|
|
|
[ '/docProps/app.xml', $app_document . 'extended-properties+xml' ], |
43
|
|
|
|
|
|
|
[ '/docProps/core.xml', $app_package . 'core-properties+xml' ], |
44
|
|
|
|
|
|
|
[ '/xl/styles.xml', $app_document . 'spreadsheetml.styles+xml' ], |
45
|
|
|
|
|
|
|
[ '/xl/theme/theme1.xml', $app_document . 'theme+xml' ], |
46
|
|
|
|
|
|
|
[ '/xl/workbook.xml', $app_document . 'spreadsheetml.sheet.main+xml' ], |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
############################################################################### |
51
|
|
|
|
|
|
|
# |
52
|
|
|
|
|
|
|
# Public and private API methods. |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
############################################################################### |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
############################################################################### |
57
|
|
|
|
|
|
|
# |
58
|
|
|
|
|
|
|
# new() |
59
|
|
|
|
|
|
|
# |
60
|
|
|
|
|
|
|
# Constructor. |
61
|
|
|
|
|
|
|
# |
62
|
|
|
|
|
|
|
sub new { |
63
|
|
|
|
|
|
|
|
64
|
813
|
|
|
813
|
0
|
5651
|
my $class = shift; |
65
|
813
|
|
|
|
|
2514
|
my $fh = shift; |
66
|
813
|
|
|
|
|
3273
|
my $self = Excel::Writer::XLSX::Package::XMLwriter->new( $fh ); |
67
|
|
|
|
|
|
|
|
68
|
813
|
|
|
|
|
4450
|
$self->{_defaults} = [@defaults]; |
69
|
813
|
|
|
|
|
3623
|
$self->{_overrides} = [@overrides]; |
70
|
|
|
|
|
|
|
|
71
|
813
|
|
|
|
|
2026
|
bless $self, $class; |
72
|
|
|
|
|
|
|
|
73
|
813
|
|
|
|
|
2584
|
return $self; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
############################################################################### |
78
|
|
|
|
|
|
|
# |
79
|
|
|
|
|
|
|
# _assemble_xml_file() |
80
|
|
|
|
|
|
|
# |
81
|
|
|
|
|
|
|
# Assemble and write the XML file. |
82
|
|
|
|
|
|
|
# |
83
|
|
|
|
|
|
|
sub _assemble_xml_file { |
84
|
|
|
|
|
|
|
|
85
|
810
|
|
|
810
|
|
2595
|
my $self = shift; |
86
|
|
|
|
|
|
|
|
87
|
810
|
|
|
|
|
10005
|
$self->xml_declaration; |
88
|
810
|
|
|
|
|
5022
|
$self->_write_types(); |
89
|
810
|
|
|
|
|
4887
|
$self->_write_defaults(); |
90
|
810
|
|
|
|
|
3903
|
$self->_write_overrides(); |
91
|
|
|
|
|
|
|
|
92
|
810
|
|
|
|
|
5421
|
$self->xml_end_tag( 'Types' ); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# Close the XML writer filehandle. |
95
|
810
|
|
|
|
|
4375
|
$self->xml_get_fh()->close(); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
############################################################################### |
100
|
|
|
|
|
|
|
# |
101
|
|
|
|
|
|
|
# _add_default() |
102
|
|
|
|
|
|
|
# |
103
|
|
|
|
|
|
|
# Add elements to the ContentTypes defaults. |
104
|
|
|
|
|
|
|
# |
105
|
|
|
|
|
|
|
sub _add_default { |
106
|
|
|
|
|
|
|
|
107
|
157
|
|
|
157
|
|
380
|
my $self = shift; |
108
|
157
|
|
|
|
|
442
|
my $part_name = shift; |
109
|
157
|
|
|
|
|
350
|
my $content_type = shift; |
110
|
|
|
|
|
|
|
|
111
|
157
|
|
|
|
|
358
|
push @{ $self->{_defaults} }, [ $part_name, $content_type ]; |
|
157
|
|
|
|
|
1261
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
############################################################################### |
117
|
|
|
|
|
|
|
# |
118
|
|
|
|
|
|
|
# _add_override() |
119
|
|
|
|
|
|
|
# |
120
|
|
|
|
|
|
|
# Add elements to the ContentTypes overrides. |
121
|
|
|
|
|
|
|
# |
122
|
|
|
|
|
|
|
sub _add_override { |
123
|
|
|
|
|
|
|
|
124
|
2134
|
|
|
2134
|
|
4732
|
my $self = shift; |
125
|
2134
|
|
|
|
|
4490
|
my $part_name = shift; |
126
|
2134
|
|
|
|
|
3892
|
my $content_type = shift; |
127
|
|
|
|
|
|
|
|
128
|
2134
|
|
|
|
|
3917
|
push @{ $self->{_overrides} }, [ $part_name, $content_type ]; |
|
2134
|
|
|
|
|
14014
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
############################################################################### |
134
|
|
|
|
|
|
|
# |
135
|
|
|
|
|
|
|
# _add_worksheet_name() |
136
|
|
|
|
|
|
|
# |
137
|
|
|
|
|
|
|
# Add the name of a worksheet to the ContentTypes overrides. |
138
|
|
|
|
|
|
|
# |
139
|
|
|
|
|
|
|
sub _add_worksheet_name { |
140
|
|
|
|
|
|
|
|
141
|
937
|
|
|
937
|
|
3562
|
my $self = shift; |
142
|
937
|
|
|
|
|
3125
|
my $worksheet_name = shift; |
143
|
|
|
|
|
|
|
|
144
|
937
|
|
|
|
|
4209
|
$worksheet_name = "/xl/worksheets/$worksheet_name.xml"; |
145
|
|
|
|
|
|
|
|
146
|
937
|
|
|
|
|
5665
|
$self->_add_override( $worksheet_name, |
147
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.worksheet+xml' ); |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
############################################################################### |
152
|
|
|
|
|
|
|
# |
153
|
|
|
|
|
|
|
# _add_chartsheet_name() |
154
|
|
|
|
|
|
|
# |
155
|
|
|
|
|
|
|
# Add the name of a chartsheet to the ContentTypes overrides. |
156
|
|
|
|
|
|
|
# |
157
|
|
|
|
|
|
|
sub _add_chartsheet_name { |
158
|
|
|
|
|
|
|
|
159
|
20
|
|
|
20
|
|
49
|
my $self = shift; |
160
|
20
|
|
|
|
|
58
|
my $chartsheet_name = shift; |
161
|
|
|
|
|
|
|
|
162
|
20
|
|
|
|
|
78
|
$chartsheet_name = "/xl/chartsheets/$chartsheet_name.xml"; |
163
|
|
|
|
|
|
|
|
164
|
20
|
|
|
|
|
97
|
$self->_add_override( $chartsheet_name, |
165
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.chartsheet+xml' ); |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
############################################################################### |
170
|
|
|
|
|
|
|
# |
171
|
|
|
|
|
|
|
# _add_chart_name() |
172
|
|
|
|
|
|
|
# |
173
|
|
|
|
|
|
|
# Add the name of a chart to the ContentTypes overrides. |
174
|
|
|
|
|
|
|
# |
175
|
|
|
|
|
|
|
sub _add_chart_name { |
176
|
|
|
|
|
|
|
|
177
|
394
|
|
|
394
|
|
1060
|
my $self = shift; |
178
|
394
|
|
|
|
|
990
|
my $chart_name = shift; |
179
|
|
|
|
|
|
|
|
180
|
394
|
|
|
|
|
1321
|
$chart_name = "/xl/charts/$chart_name.xml"; |
181
|
|
|
|
|
|
|
|
182
|
394
|
|
|
|
|
1882
|
$self->_add_override( $chart_name, $app_document . 'drawingml.chart+xml' ); |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
############################################################################### |
187
|
|
|
|
|
|
|
# |
188
|
|
|
|
|
|
|
# _add_drawing_name() |
189
|
|
|
|
|
|
|
# |
190
|
|
|
|
|
|
|
# Add the name of a drawing to the ContentTypes overrides. |
191
|
|
|
|
|
|
|
# |
192
|
|
|
|
|
|
|
sub _add_drawing_name { |
193
|
|
|
|
|
|
|
|
194
|
469
|
|
|
469
|
|
1389
|
my $self = shift; |
195
|
469
|
|
|
|
|
1179
|
my $drawing_name = shift; |
196
|
|
|
|
|
|
|
|
197
|
469
|
|
|
|
|
1679
|
$drawing_name = "/xl/drawings/$drawing_name.xml"; |
198
|
|
|
|
|
|
|
|
199
|
469
|
|
|
|
|
2315
|
$self->_add_override( $drawing_name, $app_document . 'drawing+xml' ); |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
############################################################################### |
204
|
|
|
|
|
|
|
# |
205
|
|
|
|
|
|
|
# _add_vml_name() |
206
|
|
|
|
|
|
|
# |
207
|
|
|
|
|
|
|
# Add the name of a VML drawing to the ContentTypes defaults. |
208
|
|
|
|
|
|
|
# |
209
|
|
|
|
|
|
|
sub _add_vml_name { |
210
|
|
|
|
|
|
|
|
211
|
57
|
|
|
57
|
|
156
|
my $self = shift; |
212
|
|
|
|
|
|
|
|
213
|
57
|
|
|
|
|
289
|
$self->_add_default( 'vml', $app_document . 'vmlDrawing' ); |
214
|
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
############################################################################### |
218
|
|
|
|
|
|
|
# |
219
|
|
|
|
|
|
|
# _add_comment_name() |
220
|
|
|
|
|
|
|
# |
221
|
|
|
|
|
|
|
# Add the name of a comment to the ContentTypes overrides. |
222
|
|
|
|
|
|
|
# |
223
|
|
|
|
|
|
|
sub _add_comment_name { |
224
|
|
|
|
|
|
|
|
225
|
39
|
|
|
39
|
|
93
|
my $self = shift; |
226
|
39
|
|
|
|
|
80
|
my $comment_name = shift; |
227
|
|
|
|
|
|
|
|
228
|
39
|
|
|
|
|
162
|
$comment_name = "/xl/$comment_name.xml"; |
229
|
|
|
|
|
|
|
|
230
|
39
|
|
|
|
|
159
|
$self->_add_override( $comment_name, |
231
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.comments+xml' ); |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
############################################################################### |
235
|
|
|
|
|
|
|
# |
236
|
|
|
|
|
|
|
# _Add_shared_strings() |
237
|
|
|
|
|
|
|
# |
238
|
|
|
|
|
|
|
# Add the sharedStrings link to the ContentTypes overrides. |
239
|
|
|
|
|
|
|
# |
240
|
|
|
|
|
|
|
sub _add_shared_strings { |
241
|
|
|
|
|
|
|
|
242
|
235
|
|
|
235
|
|
966
|
my $self = shift; |
243
|
|
|
|
|
|
|
|
244
|
235
|
|
|
|
|
1456
|
$self->_add_override( '/xl/sharedStrings.xml', |
245
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.sharedStrings+xml' ); |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
############################################################################### |
250
|
|
|
|
|
|
|
# |
251
|
|
|
|
|
|
|
# _add_calc_chain() |
252
|
|
|
|
|
|
|
# |
253
|
|
|
|
|
|
|
# Add the calcChain link to the ContentTypes overrides. |
254
|
|
|
|
|
|
|
# |
255
|
|
|
|
|
|
|
sub _add_calc_chain { |
256
|
|
|
|
|
|
|
|
257
|
1
|
|
|
1
|
|
6
|
my $self = shift; |
258
|
|
|
|
|
|
|
|
259
|
1
|
|
|
|
|
4
|
$self->_add_override( '/xl/calcChain.xml', |
260
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.calcChain+xml' ); |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
############################################################################### |
265
|
|
|
|
|
|
|
# |
266
|
|
|
|
|
|
|
# _add_image_types() |
267
|
|
|
|
|
|
|
# |
268
|
|
|
|
|
|
|
# Add the image default types. |
269
|
|
|
|
|
|
|
# |
270
|
|
|
|
|
|
|
sub _add_image_types { |
271
|
|
|
|
|
|
|
|
272
|
809
|
|
|
809
|
|
1970
|
my $self = shift; |
273
|
809
|
|
|
|
|
2914
|
my %types = @_; |
274
|
|
|
|
|
|
|
|
275
|
809
|
|
|
|
|
4402
|
for my $type ( keys %types ) { |
276
|
94
|
|
|
|
|
558
|
$self->_add_default( $type, 'image/' . $type ); |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
############################################################################### |
282
|
|
|
|
|
|
|
# |
283
|
|
|
|
|
|
|
# _add_table_name() |
284
|
|
|
|
|
|
|
# |
285
|
|
|
|
|
|
|
# Add the name of a table to the ContentTypes overrides. |
286
|
|
|
|
|
|
|
# |
287
|
|
|
|
|
|
|
sub _add_table_name { |
288
|
|
|
|
|
|
|
|
289
|
35
|
|
|
35
|
|
77
|
my $self = shift; |
290
|
35
|
|
|
|
|
103
|
my $table_name = shift; |
291
|
|
|
|
|
|
|
|
292
|
35
|
|
|
|
|
118
|
$table_name = "/xl/tables/$table_name.xml"; |
293
|
|
|
|
|
|
|
|
294
|
35
|
|
|
|
|
145
|
$self->_add_override( $table_name, |
295
|
|
|
|
|
|
|
$app_document . 'spreadsheetml.table+xml' ); |
296
|
|
|
|
|
|
|
} |
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
############################################################################### |
300
|
|
|
|
|
|
|
# |
301
|
|
|
|
|
|
|
# _add_vba_project() |
302
|
|
|
|
|
|
|
# |
303
|
|
|
|
|
|
|
# Add a vbaProject to the ContentTypes defaults. |
304
|
|
|
|
|
|
|
# |
305
|
|
|
|
|
|
|
sub _add_vba_project { |
306
|
|
|
|
|
|
|
|
307
|
5
|
|
|
5
|
|
12
|
my $self = shift; |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
# Change the workbook.xml content-type from xlsx to xlsm. |
310
|
5
|
|
|
|
|
11
|
for my $aref ( @{ $self->{_overrides} } ) { |
|
5
|
|
|
|
|
14
|
|
311
|
30
|
100
|
|
|
|
88
|
if ( $aref->[0] eq '/xl/workbook.xml' ) { |
312
|
5
|
|
|
|
|
15
|
$aref->[1] = 'application/vnd.ms-excel.sheet.macroEnabled.main+xml'; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
|
316
|
5
|
|
|
|
|
26
|
$self->_add_default( 'bin', 'application/vnd.ms-office.vbaProject' ); |
317
|
|
|
|
|
|
|
} |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
############################################################################### |
321
|
|
|
|
|
|
|
# |
322
|
|
|
|
|
|
|
# _add_custom_properties() |
323
|
|
|
|
|
|
|
# |
324
|
|
|
|
|
|
|
# Add the custom properties to the ContentTypes overrides. |
325
|
|
|
|
|
|
|
# |
326
|
|
|
|
|
|
|
sub _add_custom_properties { |
327
|
|
|
|
|
|
|
|
328
|
4
|
|
|
4
|
|
9
|
my $self = shift; |
329
|
4
|
|
|
|
|
9
|
my $custom = "/docProps/custom.xml"; |
330
|
|
|
|
|
|
|
|
331
|
4
|
|
|
|
|
12
|
$self->_add_override( $custom, $app_document . 'custom-properties+xml' ); |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
############################################################################### |
336
|
|
|
|
|
|
|
# |
337
|
|
|
|
|
|
|
# Internal methods. |
338
|
|
|
|
|
|
|
# |
339
|
|
|
|
|
|
|
############################################################################### |
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
############################################################################### |
343
|
|
|
|
|
|
|
# |
344
|
|
|
|
|
|
|
# _write_defaults() |
345
|
|
|
|
|
|
|
# |
346
|
|
|
|
|
|
|
# Write out all of the types. |
347
|
|
|
|
|
|
|
# |
348
|
|
|
|
|
|
|
sub _write_defaults { |
349
|
|
|
|
|
|
|
|
350
|
810
|
|
|
810
|
|
2219
|
my $self = shift; |
351
|
|
|
|
|
|
|
|
352
|
810
|
|
|
|
|
2036
|
for my $aref ( @{ $self->{_defaults} } ) { |
|
810
|
|
|
|
|
3403
|
|
353
|
|
|
|
|
|
|
#<<< |
354
|
1777
|
|
|
|
|
8573
|
$self->xml_empty_tag( |
355
|
|
|
|
|
|
|
'Default', |
356
|
|
|
|
|
|
|
'Extension', $aref->[0], |
357
|
|
|
|
|
|
|
'ContentType', $aref->[1] ); |
358
|
|
|
|
|
|
|
#>>> |
359
|
|
|
|
|
|
|
} |
360
|
|
|
|
|
|
|
} |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
############################################################################### |
364
|
|
|
|
|
|
|
# |
365
|
|
|
|
|
|
|
# _write_overrides() |
366
|
|
|
|
|
|
|
# |
367
|
|
|
|
|
|
|
# Write out all of the types. |
368
|
|
|
|
|
|
|
# |
369
|
|
|
|
|
|
|
sub _write_overrides { |
370
|
|
|
|
|
|
|
|
371
|
810
|
|
|
810
|
|
2163
|
my $self = shift; |
372
|
|
|
|
|
|
|
|
373
|
810
|
|
|
|
|
1962
|
for my $aref ( @{ $self->{_overrides} } ) { |
|
810
|
|
|
|
|
2960
|
|
374
|
|
|
|
|
|
|
#<<< |
375
|
6184
|
|
|
|
|
16894
|
$self->xml_empty_tag( |
376
|
|
|
|
|
|
|
'Override', |
377
|
|
|
|
|
|
|
'PartName', $aref->[0], |
378
|
|
|
|
|
|
|
'ContentType', $aref->[1] ); |
379
|
|
|
|
|
|
|
#>>> |
380
|
|
|
|
|
|
|
} |
381
|
|
|
|
|
|
|
} |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
############################################################################### |
385
|
|
|
|
|
|
|
# |
386
|
|
|
|
|
|
|
# XML writing methods. |
387
|
|
|
|
|
|
|
# |
388
|
|
|
|
|
|
|
############################################################################### |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
############################################################################### |
392
|
|
|
|
|
|
|
# |
393
|
|
|
|
|
|
|
# _write_types() |
394
|
|
|
|
|
|
|
# |
395
|
|
|
|
|
|
|
# Write the element. |
396
|
|
|
|
|
|
|
# |
397
|
|
|
|
|
|
|
sub _write_types { |
398
|
|
|
|
|
|
|
|
399
|
810
|
|
|
810
|
|
2472
|
my $self = shift; |
400
|
810
|
|
|
|
|
2265
|
my $xmlns = 'http://schemas.openxmlformats.org/package/2006/content-types'; |
401
|
|
|
|
|
|
|
|
402
|
810
|
|
|
|
|
3616
|
my @attributes = ( 'xmlns' => $xmlns, ); |
403
|
|
|
|
|
|
|
|
404
|
810
|
|
|
|
|
5430
|
$self->xml_start_tag( 'Types', @attributes ); |
405
|
|
|
|
|
|
|
} |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
############################################################################### |
408
|
|
|
|
|
|
|
# |
409
|
|
|
|
|
|
|
# _write_default() |
410
|
|
|
|
|
|
|
# |
411
|
|
|
|
|
|
|
# Write the element. |
412
|
|
|
|
|
|
|
# |
413
|
|
|
|
|
|
|
sub _write_default { |
414
|
|
|
|
|
|
|
|
415
|
1
|
|
|
1
|
|
14
|
my $self = shift; |
416
|
1
|
|
|
|
|
2
|
my $extension = shift; |
417
|
1
|
|
|
|
|
3
|
my $content_type = shift; |
418
|
|
|
|
|
|
|
|
419
|
1
|
|
|
|
|
4
|
my @attributes = ( |
420
|
|
|
|
|
|
|
'Extension' => $extension, |
421
|
|
|
|
|
|
|
'ContentType' => $content_type, |
422
|
|
|
|
|
|
|
); |
423
|
|
|
|
|
|
|
|
424
|
1
|
|
|
|
|
12
|
$self->xml_empty_tag( 'Default', @attributes ); |
425
|
|
|
|
|
|
|
} |
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
############################################################################### |
429
|
|
|
|
|
|
|
# |
430
|
|
|
|
|
|
|
# _write_override() |
431
|
|
|
|
|
|
|
# |
432
|
|
|
|
|
|
|
# Write the element. |
433
|
|
|
|
|
|
|
# |
434
|
|
|
|
|
|
|
sub _write_override { |
435
|
|
|
|
|
|
|
|
436
|
1
|
|
|
1
|
|
12
|
my $self = shift; |
437
|
1
|
|
|
|
|
1
|
my $part_name = shift; |
438
|
1
|
|
|
|
|
3
|
my $content_type = shift; |
439
|
1
|
|
|
|
|
2
|
my $writer = $self; |
440
|
|
|
|
|
|
|
|
441
|
1
|
|
|
|
|
4
|
my @attributes = ( |
442
|
|
|
|
|
|
|
'PartName' => $part_name, |
443
|
|
|
|
|
|
|
'ContentType' => $content_type, |
444
|
|
|
|
|
|
|
); |
445
|
|
|
|
|
|
|
|
446
|
1
|
|
|
|
|
11
|
$self->xml_empty_tag( 'Override', @attributes ); |
447
|
|
|
|
|
|
|
} |
448
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
1; |
451
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
__END__ |