html2odt 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,388 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ xhtml2odt - XHTML to ODT XML transformation.
5
+ Copyright (C) 2009 Aurelien Bompard
6
+ Inspired by the work on docbook2odt, by Roman Fordinal
7
+ http://open.comsultia.com/docbook2odf/
8
+
9
+ License: LGPL v2.1 or later <http://www.gnu.org/licenses/lgpl-2.1.html>
10
+
11
+ This library is free software; you can redistribute it and/or
12
+ modify it under the terms of the GNU Lesser General Public
13
+ License as published by the Free Software Foundation; either
14
+ version 2.1 of the License, or (at your option) any later version.
15
+
16
+ This library is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
+ Lesser General Public License for more details.
20
+
21
+ You should have received a copy of the GNU Lesser General Public
22
+ License along with this library; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24
+ MA 02110-1301 USA
25
+
26
+ -->
27
+ <xsl:stylesheet
28
+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
29
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
31
+ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
32
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
33
+ xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
34
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
35
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
36
+ xmlns:xlink="http://www.w3.org/1999/xlink"
37
+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
38
+ xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
39
+ xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
40
+ xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
41
+ xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
42
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
43
+ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
44
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
45
+ xmlns:dom="http://www.w3.org/2001/xml-events"
46
+ xmlns:xforms="http://www.w3.org/2002/xforms"
47
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
48
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49
+ xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
50
+ version="1.0">
51
+
52
+ <xsl:template name="autostyles">
53
+
54
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'big']) = 0">
55
+ <style:style style:name="big" style:family="text">
56
+ <style:text-properties fo:font-size="120%"/>
57
+ </style:style>
58
+ </xsl:if>
59
+
60
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'left']) = 0">
61
+ <style:style style:name="left" style:family="paragraph"
62
+ style:parent-style-name="Text_20_body">
63
+ <style:paragraph-properties fo:text-align="left"
64
+ style:justify-single-word="false"/>
65
+ </style:style>
66
+ </xsl:if>
67
+
68
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'center']) = 0">
69
+ <style:style style:name="center" style:family="paragraph"
70
+ style:parent-style-name="Text_20_body">
71
+ <style:paragraph-properties fo:text-align="center"
72
+ style:justify-single-word="false"/>
73
+ </style:style>
74
+ </xsl:if>
75
+
76
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'right']) = 0">
77
+ <style:style style:name="right" style:family="paragraph"
78
+ style:parent-style-name="Text_20_body">
79
+ <style:paragraph-properties fo:text-align="right"
80
+ style:justify-single-word="false"/>
81
+ </style:style>
82
+ </xsl:if>
83
+
84
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'justify']) = 0">
85
+ <style:style style:name="justify" style:family="paragraph"
86
+ style:parent-style-name="Text_20_body">
87
+ <style:paragraph-properties fo:text-align="justify"
88
+ style:justify-single-word="false"/>
89
+ </style:style>
90
+ </xsl:if>
91
+
92
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'emphasis']) = 0">
93
+ <style:style style:name="emphasis" style:family="text">
94
+ <style:text-properties fo:font-style="italic"/>
95
+ </style:style>
96
+ </xsl:if>
97
+
98
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'image-center']) = 0">
99
+ <style:style style:name="image-center" style:family="graphic"
100
+ style:parent-style-name="Graphics">
101
+ <style:graphic-properties style:wrap="none"
102
+ style:horizontal-pos="center"
103
+ style:horizontal-rel="paragraph"/>
104
+ </style:style>
105
+ </xsl:if>
106
+
107
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'image-inline']) = 0">
108
+ <style:style style:name="image-inline" style:family="graphic"
109
+ style:parent-style-name="Graphics">
110
+ <style:graphic-properties style:vertical-pos="middle"
111
+ style:vertical-rel="text"/>
112
+ </style:style>
113
+ </xsl:if>
114
+
115
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'image-left']) = 0">
116
+ <style:style style:name="image-left" style:family="graphic"
117
+ style:parent-style-name="Graphics">
118
+ <style:graphic-properties style:wrap="right" style:vertical-pos="top"
119
+ style:vertical-rel="paragraph-content"
120
+ style:horizontal-pos="left"
121
+ style:horizontal-rel="paragraph"
122
+ style:flow-with-text="true"/>
123
+ </style:style>
124
+ </xsl:if>
125
+
126
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'image-right']) = 0">
127
+ <style:style style:name="image-right" style:family="graphic"
128
+ style:parent-style-name="Graphics">
129
+ <style:graphic-properties style:wrap="left" style:vertical-pos="top"
130
+ style:vertical-rel="paragraph-content"
131
+ style:horizontal-pos="right"
132
+ style:horizontal-rel="paragraph"
133
+ style:flow-with-text="true"/>
134
+ </style:style>
135
+ </xsl:if>
136
+
137
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'list-item-bullet']) = 0">
138
+ <style:style style:name="list-item-bullet" style:family="paragraph"
139
+ style:parent-style-name="Text_20_body"
140
+ style:list-style-name="List_20_1"/>
141
+ </xsl:if>
142
+
143
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'list-item-number']) = 0">
144
+ <style:style style:name="list-item-number" style:family="paragraph"
145
+ style:parent-style-name="Text_20_body"
146
+ style:list-style-name="Numbering_20_1"/>
147
+ </xsl:if>
148
+
149
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'small']) = 0">
150
+ <style:style style:name="small" style:family="text">
151
+ <style:text-properties fo:font-size="80%"/>
152
+ </style:style>
153
+ </xsl:if>
154
+
155
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'strike']) = 0">
156
+ <style:style style:name="strike" style:family="text">
157
+ <style:text-properties style:text-line-through-style="solid"/>
158
+ </style:style>
159
+ </xsl:if>
160
+
161
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'strong']) = 0">
162
+ <style:style style:name="strong" style:family="text">
163
+ <style:text-properties fo:font-weight="bold"/>
164
+ </style:style>
165
+ </xsl:if>
166
+
167
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'sub']) = 0">
168
+ <style:style style:name="sub" style:family="text">
169
+ <style:text-properties style:text-position="sub 58%"/>
170
+ </style:style>
171
+ </xsl:if>
172
+
173
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'sup']) = 0">
174
+ <style:style style:name="sup" style:family="text">
175
+ <style:text-properties style:text-position="super 58%"/>
176
+ </style:style>
177
+ </xsl:if>
178
+
179
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-A1']) = 0">
180
+ <style:style style:name="table-default.cell-A1" style:family="table-cell">
181
+ <style:table-cell-properties fo:padding="0.05cm"
182
+ fo:border-left="0.03cm solid #000000"
183
+ fo:border-right="none"
184
+ fo:border-top="0.03cm solid #000000"
185
+ fo:border-bottom="0.01cm solid #000000"/>
186
+ </style:style>
187
+ </xsl:if>
188
+
189
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-A2']) = 0">
190
+ <style:style style:name="table-default.cell-A2" style:family="table-cell">
191
+ <style:table-cell-properties fo:padding="0.05cm"
192
+ fo:border-left="0.03cm solid #000000"
193
+ fo:border-right="none"
194
+ fo:border-top="none"
195
+ fo:border-bottom="0.01cm solid #000000"/>
196
+ </style:style>
197
+ </xsl:if>
198
+
199
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-A3']) = 0">
200
+ <style:style style:name="table-default.cell-A3" style:family="table-cell">
201
+ <style:table-cell-properties fo:padding="0.05cm"
202
+ fo:border-left="0.03cm solid #000000"
203
+ fo:border-right="none"
204
+ fo:border-top="none"
205
+ fo:border-bottom="0.03cm solid #000000"/>
206
+ </style:style>
207
+ </xsl:if>
208
+
209
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-A4']) = 0">
210
+ <style:style style:name="table-default.cell-A4" style:family="table-cell">
211
+ <style:table-cell-properties fo:padding="0.05cm"
212
+ fo:border-left="0.03cm solid #000000"
213
+ fo:border-right="none"
214
+ fo:border-top="0.03cm solid #000000"
215
+ fo:border-bottom="0.03cm solid #000000"/>
216
+ </style:style>
217
+ </xsl:if>
218
+
219
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-B1']) = 0">
220
+ <style:style style:name="table-default.cell-B1" style:family="table-cell">
221
+ <style:table-cell-properties fo:padding="0.05cm"
222
+ fo:border-left="0.01cm solid #000000"
223
+ fo:border-right="none"
224
+ fo:border-top="0.03cm solid #000000"
225
+ fo:border-bottom="0.01cm solid #000000"/>
226
+ </style:style>
227
+ </xsl:if>
228
+
229
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-B2']) = 0">
230
+ <style:style style:name="table-default.cell-B2" style:family="table-cell">
231
+ <style:table-cell-properties fo:padding="0.05cm"
232
+ fo:border-left="0.01cm solid #000000"
233
+ fo:border-right="none"
234
+ fo:border-top="none"
235
+ fo:border-bottom="0.01cm solid #000000"/>
236
+ </style:style>
237
+ </xsl:if>
238
+
239
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-B3']) = 0">
240
+ <style:style style:name="table-default.cell-B3" style:family="table-cell">
241
+ <style:table-cell-properties fo:padding="0.05cm"
242
+ fo:border-left="0.01cm solid #000000"
243
+ fo:border-right="none"
244
+ fo:border-top="none"
245
+ fo:border-bottom="0.03cm solid #000000"/>
246
+ </style:style>
247
+ </xsl:if>
248
+
249
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-B4']) = 0">
250
+ <style:style style:name="table-default.cell-B4" style:family="table-cell">
251
+ <style:table-cell-properties fo:padding="0.05cm"
252
+ fo:border-left="0.01cm solid #000000"
253
+ fo:border-right="none"
254
+ fo:border-top="0.03cm solid #000000"
255
+ fo:border-bottom="0.03cm solid #000000"/>
256
+ </style:style>
257
+ </xsl:if>
258
+
259
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-C1']) = 0">
260
+ <style:style style:name="table-default.cell-C1" style:family="table-cell">
261
+ <style:table-cell-properties fo:padding="0.05cm"
262
+ fo:border-left="0.01cm solid #000000"
263
+ fo:border-right="0.03cm solid #000000"
264
+ fo:border-top="0.03cm solid #000000"
265
+ fo:border-bottom="0.01cm solid #000000"/>
266
+ </style:style>
267
+ </xsl:if>
268
+
269
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-C2']) = 0">
270
+ <style:style style:name="table-default.cell-C2" style:family="table-cell">
271
+ <style:table-cell-properties fo:padding="0.05cm"
272
+ fo:border-left="0.01cm solid #000000"
273
+ fo:border-right="0.03cm solid #000000"
274
+ fo:border-top="none"
275
+ fo:border-bottom="0.01cm solid #000000"/>
276
+ </style:style>
277
+ </xsl:if>
278
+
279
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-C3']) = 0">
280
+ <style:style style:name="table-default.cell-C3" style:family="table-cell">
281
+ <style:table-cell-properties fo:padding="0.05cm"
282
+ fo:border-left="0.01cm solid #000000"
283
+ fo:border-right="0.03cm solid #000000"
284
+ fo:border-top="none"
285
+ fo:border-bottom="0.03cm solid #000000"/>
286
+ </style:style>
287
+ </xsl:if>
288
+
289
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-C4']) = 0">
290
+ <style:style style:name="table-default.cell-C4" style:family="table-cell">
291
+ <style:table-cell-properties fo:padding="0.05cm"
292
+ fo:border-left="0.01cm solid #000000"
293
+ fo:border-right="0.03cm solid #000000"
294
+ fo:border-top="0.03cm solid #000000"
295
+ fo:border-bottom="0.03cm solid #000000"/>
296
+ </style:style>
297
+ </xsl:if>
298
+
299
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-F-A3']) = 0">
300
+ <style:style style:name="table-default.cell-F-A3" style:family="table-cell">
301
+ <style:table-cell-properties fo:padding="0.05cm"
302
+ fo:border-left="0.03cm solid #000000"
303
+ fo:border-right="none"
304
+ fo:border-top="0.03cm solid #000000"
305
+ fo:border-bottom="0.03cm solid #000000"/>
306
+ </style:style>
307
+ </xsl:if>
308
+
309
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-F-B3']) = 0">
310
+ <style:style style:name="table-default.cell-F-B3" style:family="table-cell">
311
+ <style:table-cell-properties fo:padding="0.05cm"
312
+ fo:border-left="0.01cm solid #000000"
313
+ fo:border-right="none"
314
+ fo:border-top="0.03cm solid #000000"
315
+ fo:border-bottom="0.03cm solid #000000"/>
316
+ </style:style>
317
+ </xsl:if>
318
+
319
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-F-C3']) = 0">
320
+ <style:style style:name="table-default.cell-F-C3" style:family="table-cell">
321
+ <style:table-cell-properties fo:padding="0.05cm"
322
+ fo:border-left="0.01cm solid #000000"
323
+ fo:border-right="0.03cm solid #000000"
324
+ fo:border-top="0.03cm solid #000000"
325
+ fo:border-bottom="0.03cm solid #000000"/>
326
+ </style:style>
327
+ </xsl:if>
328
+
329
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-H-A1']) = 0">
330
+ <style:style style:name="table-default.cell-H-A1" style:family="table-cell">
331
+ <style:table-cell-properties fo:padding="0.05cm"
332
+ fo:border-left="0.03cm solid #000000"
333
+ fo:border-right="none"
334
+ fo:border-top="0.03cm solid #000000"
335
+ fo:border-bottom="0.03cm solid #000000"/>
336
+ </style:style>
337
+ </xsl:if>
338
+
339
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-H-B1']) = 0">
340
+ <style:style style:name="table-default.cell-H-B1" style:family="table-cell">
341
+ <style:table-cell-properties fo:padding="0.05cm"
342
+ fo:border-left="0.01cm solid #000000"
343
+ fo:border-right="none"
344
+ fo:border-top="0.03cm solid #000000"
345
+ fo:border-bottom="0.03cm solid #000000"/>
346
+ </style:style>
347
+ </xsl:if>
348
+
349
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-H-C1']) = 0">
350
+ <style:style style:name="table-default.cell-H-C1" style:family="table-cell">
351
+ <style:table-cell-properties fo:padding="0.05cm"
352
+ fo:border-left="0.01cm solid #000000"
353
+ fo:border-right="0.03cm solid #000000"
354
+ fo:border-top="0.03cm solid #000000"
355
+ fo:border-bottom="0.03cm solid #000000"/>
356
+ </style:style>
357
+ </xsl:if>
358
+
359
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default.cell-single']) = 0">
360
+ <style:style style:name="table-default.cell-single" style:family="table-cell">
361
+ <style:table-cell-properties fo:padding="0.05cm"
362
+ fo:border-left="0.03cm solid #000000"
363
+ fo:border-right="0.03cm solid #000000"
364
+ fo:border-top="0.03cm solid #000000"
365
+ fo:border-bottom="0.03cm solid #000000"/>
366
+ </style:style>
367
+ </xsl:if>
368
+
369
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'table-default']) = 0">
370
+ <style:style style:name="table-default" style:family="table">
371
+ <style:table-properties style:width="100%" table:align="margins"/>
372
+ </style:style>
373
+ </xsl:if>
374
+
375
+
376
+ <!-- Specific -->
377
+
378
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'underline']) = 0">
379
+ <style:style style:name="underline" style:family="text">
380
+ <style:text-properties style:text-underline-style="solid"
381
+ style:text-underline-width="auto"
382
+ style:text-underline-color="font-color"/>
383
+ </style:style>
384
+ </xsl:if>
385
+
386
+ </xsl:template>
387
+
388
+ </xsl:stylesheet>
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ xhtml2odt - XHTML to ODT XML transformation.
5
+ Copyright (C) 2009 Aurelien Bompard
6
+ Inspired by the work on docbook2odt, by Roman Fordinal
7
+ http://open.comsultia.com/docbook2odf/
8
+
9
+ License: LGPL v2.1 or later <http://www.gnu.org/licenses/lgpl-2.1.html>
10
+
11
+ This library is free software; you can redistribute it and/or
12
+ modify it under the terms of the GNU Lesser General Public
13
+ License as published by the Free Software Foundation; either
14
+ version 2.1 of the License, or (at your option) any later version.
15
+
16
+ This library is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
+ Lesser General Public License for more details.
20
+
21
+ You should have received a copy of the GNU Lesser General Public
22
+ License along with this library; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24
+ MA 02110-1301 USA
25
+
26
+ -->
27
+ <xsl:stylesheet
28
+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
29
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
31
+ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
32
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
33
+ xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
34
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
35
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
36
+ xmlns:xlink="http://www.w3.org/1999/xlink"
37
+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
38
+ xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
39
+ xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
40
+ xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
41
+ xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
42
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
43
+ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
44
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
45
+ xmlns:dom="http://www.w3.org/2001/xml-events"
46
+ xmlns:xforms="http://www.w3.org/2002/xforms"
47
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
48
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49
+ xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
50
+ version="1.0">
51
+
52
+ <xsl:template name="fonts">
53
+
54
+ <xsl:if test="count(//office:font-face-decls/style:font-face[@style:name = 'DejaVu Sans Mono']) = 0">
55
+ <style:font-face style:name="DejaVu Sans Mono"
56
+ svg:font-family="&apos;DejaVu Sans Mono&apos;"
57
+ style:font-family-generic="modern" style:font-pitch="fixed"/>
58
+ </xsl:if>
59
+
60
+ </xsl:template>
61
+
62
+ </xsl:stylesheet>
@@ -0,0 +1,152 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ xhtml2odt - XHTML to ODT XML transformation.
5
+ Copyright (C) 2009 Aurelien Bompard
6
+ Inspired by the work on docbook2odt, by Roman Fordinal
7
+ http://open.comsultia.com/docbook2odf/
8
+
9
+ License: LGPL v2.1 or later <http://www.gnu.org/licenses/lgpl-2.1.html>
10
+
11
+ This library is free software; you can redistribute it and/or
12
+ modify it under the terms of the GNU Lesser General Public
13
+ License as published by the Free Software Foundation; either
14
+ version 2.1 of the License, or (at your option) any later version.
15
+
16
+ This library is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19
+ Lesser General Public License for more details.
20
+
21
+ You should have received a copy of the GNU Lesser General Public
22
+ License along with this library; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24
+ MA 02110-1301 USA
25
+
26
+ -->
27
+ <xsl:stylesheet
28
+ xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
29
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
31
+ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
32
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
33
+ xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
34
+ xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
35
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
36
+ xmlns:xlink="http://www.w3.org/1999/xlink"
37
+ xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
38
+ xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
39
+ xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
40
+ xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
41
+ xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
42
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
43
+ xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
44
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
45
+ xmlns:dom="http://www.w3.org/2001/xml-events"
46
+ xmlns:xforms="http://www.w3.org/2002/xforms"
47
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
48
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49
+ xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
50
+ version="1.0">
51
+
52
+ <xsl:template name="highlight">
53
+
54
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.class']) = 0
55
+ and count(//*[@text:style-name='syntax-highlight.class']) > 0">
56
+ <style:style style:name="syntax-highlight.class" style:family="text">
57
+ <style:text-properties fo:color="#445588"
58
+ fo:font-weight="bold"/>
59
+ </style:style>
60
+ </xsl:if>
61
+
62
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.function']) = 0
63
+ and count(//*[@text:style-name='syntax-highlight.function']) > 0">
64
+ <style:style style:name="syntax-highlight.function" style:family="text">
65
+ <style:text-properties fo:color="#990000"
66
+ fo:font-weight="bold"/>
67
+ </style:style>
68
+ </xsl:if>
69
+
70
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.tag']) = 0
71
+ and count(//*[@text:style-name='syntax-highlight.tag']) > 0">
72
+ <style:style style:name="syntax-highlight.tag" style:family="text">
73
+ <style:text-properties fo:color="#000080"/>
74
+ </style:style>
75
+ </xsl:if>
76
+
77
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.attr']) = 0
78
+ and count(//*[@text:style-name='syntax-highlight.attr']) > 0">
79
+ <style:style style:name="syntax-highlight.attr" style:family="text">
80
+ <style:text-properties fo:color="#008080"/>
81
+ </style:style>
82
+ </xsl:if>
83
+
84
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.builtin']) = 0
85
+ and count(//*[@text:style-name='syntax-highlight.builtin']) > 0">
86
+ <style:style style:name="syntax-highlight.builtin" style:family="text">
87
+ <style:text-properties fo:color="#999999"/>
88
+ </style:style>
89
+ </xsl:if>
90
+
91
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.namespace']) = 0
92
+ and count(//*[@text:style-name='syntax-highlight.namespace']) > 0">
93
+ <style:style style:name="syntax-highlight.namespace" style:family="text">
94
+ <style:text-properties fo:color="#555555"/>
95
+ </style:style>
96
+ </xsl:if>
97
+
98
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.exception']) = 0
99
+ and count(//*[@text:style-name='syntax-highlight.exception']) > 0">
100
+ <style:style style:name="syntax-highlight.exception" style:family="text">
101
+ <style:text-properties fo:color="#990000"
102
+ fo:font-weight="bold"/>
103
+ </style:style>
104
+ </xsl:if>
105
+
106
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.var']) = 0
107
+ and count(//*[@text:style-name='syntax-highlight.var']) > 0">
108
+ <style:style style:name="syntax-highlight.var" style:family="text">
109
+ <style:text-properties fo:color="#009999"/>
110
+ </style:style>
111
+ </xsl:if>
112
+
113
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.builtin.pseudo']) = 0
114
+ and count(//*[@text:style-name='syntax-highlight.builtin.pseudo']) > 0">
115
+ <style:style style:name="syntax-highlight.builtin.pseudo" style:family="text">
116
+ <style:text-properties fo:color="#999999"/>
117
+ </style:style>
118
+ </xsl:if>
119
+
120
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.string']) = 0
121
+ and count(//*[@text:style-name='syntax-highlight.string']) > 0">
122
+ <style:style style:name="syntax-highlight.string" style:family="text">
123
+ <style:text-properties fo:color="#bb8844"/>
124
+ </style:style>
125
+ </xsl:if>
126
+
127
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.number']) = 0
128
+ and count(//*[@text:style-name='syntax-highlight.number']) > 0">
129
+ <style:style style:name="syntax-highlight.number" style:family="text">
130
+ <style:text-properties fo:color="#009999"/>
131
+ </style:style>
132
+ </xsl:if>
133
+
134
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.comment']) = 0
135
+ and count(//*[@text:style-name='syntax-highlight.comment']) > 0">
136
+ <style:style style:name="syntax-highlight.comment" style:family="text">
137
+ <style:text-properties fo:color="#999988"
138
+ fo:font-style="italic"/>
139
+ </style:style>
140
+ </xsl:if>
141
+
142
+ <xsl:if test="count(//office:automatic-styles/style:style[@style:name = 'syntax-highlight.error']) = 0
143
+ and count(//*[@text:style-name='syntax-highlight.error']) > 0">
144
+ <style:style style:name="syntax-highlight.error" style:family="text">
145
+ <style:text-properties fo:color="#a61717"
146
+ fo:background-color="#e3d2d2"/>
147
+ </style:style>
148
+ </xsl:if>
149
+
150
+ </xsl:template>
151
+
152
+ </xsl:stylesheet>