]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - admin/odt2phpwiki.xsl
Allow bold, italics or underlined for numbers
[SourceForge/phpwiki.git] / admin / odt2phpwiki.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!-- 
4     odt2phpwiki: OpenDocument to Phpwiki transformation
5     Copyright (C) 2007  Bernhard Haumacher (haui at haumacher dot de)
6     Copyright (C) 2008-2009  Marc-Etienne Vargenau, Alcatel-Lucent
7
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17
18     You should have received a copy of the GNU General Public License along
19     with this program; if not, write to the Free Software Foundation, Inc.,
20     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
21
22     This program is based on the OpenDocument to Mediawiki converter by
23     Bernhard Haumacher.
24
25     Modifications to convert to Phpwiki were made by Marc-Etienne Vargenau
26     and are Copyright (C) 2008-2009 Alcatel-Lucent
27
28     Standard Alcatel-Lucent disclaimer for contributing to open source
29
30     "The OpenDocument to Phpwiki converter ("Contribution") has not been tested and/or
31     validated for release as or in products, combinations with products or
32     other commercial use. Any use of the Contribution is entirely made at
33     the user's own responsibility and the user can not rely on any features,
34     functionalities or performances Alcatel-Lucent has attributed to the
35     Contribution.
36
37     THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
38     OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
39     WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
40     NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
41     CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
42     ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
43     CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
44     CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
45     TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
46     ALONE BASIS."
47
48 -->
49 <stylesheet version="1.0" 
50         xmlns="http://www.w3.org/1999/XSL/Transform"
51
52         xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
53         xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
54         xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
55         xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
56         xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
57         xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
58         xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
59         xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
60         xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
61         xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
62         xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
63         xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
64         xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
65         xmlns:xlink="http://www.w3.org/1999/xlink" 
66         xmlns:dc="http://purl.org/dc/elements/1.1/" 
67         xmlns:math="http://www.w3.org/1998/Math/MathML" 
68         xmlns:dom="http://www.w3.org/2001/xml-events" 
69         xmlns:xforms="http://www.w3.org/2002/xforms" 
70         xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
71         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
72 >
73         <output 
74                 method="text" 
75                 media-type="text/plain" 
76                 encoding="UTF-8"
77         />
78
79         <!-- 
80                 == Reference resolution == 
81         -->
82
83         <key
84                 name="style-ref"
85                 match="//style:style"
86                 use="@style:name"
87         />
88
89         <key
90                 name="list-style-ref"
91                 match="//text:list-style"
92                 use="@style:name"
93         />
94         
95         <key
96                 name="font-face-ref"
97                 match="//style:font-face"
98                 use="@style:name"
99         />
100         
101         <key
102                 name="reference-resolution"
103                 match="//text:reference-mark | //text:reference-mark-start"
104                 use="@text:name"
105         />
106         
107
108         <!-- Wiki style constants. -->
109         
110         <!-- Bold character style. -->
111         <variable name="BOLD_BIT" select="1"/>
112
113         <!-- Italic character style. -->
114         <variable name="ITALIC_BIT" select="2"/>
115
116         <!-- Subscript character style. -->
117         <variable name="SUBSCRIPT_BIT" select="4"/>
118
119         <!-- Superscript character style. -->
120         <variable name="SUPERSCRIPT_BIT" select="8"/>
121
122         <!-- Typewriter character style. -->
123         <variable name="TYPEWRITER_BIT" select="16"/>
124         
125         <!-- Preformatted text paragraph style. -->
126         <variable name="CODE_BIT" select="32"/>
127
128         <!-- Centered paragraph style. -->
129         <variable name="CENTER_BIT" select="64"/>
130
131         <!-- Right aligned paragraph style. -->
132         <variable name="RIGHT_BIT" select="128"/>
133         
134         <!-- Constant defining the empty style. -->
135         <variable name="NO_STYLE" select="0"/>
136
137         <!-- Constant defining the newline token. -->
138         <variable name="NL" select="'&#10;'"/>
139
140         <!-- 
141                 Multiple pages (draw only)
142         -->
143
144         <template match="draw:page">
145                 <value-of select="concat('&#10;&lt;!-- Page ', @draw:name, '--&gt;&#10;')"/>
146                 <apply-templates/>
147                 <value-of select="'&#10;----&#10;&#10;'"/>
148         </template>
149
150
151         <!-- 
152                 == Lists == 
153         -->
154
155         <template match="text:list-item">
156                 <if test="position() &gt; 1 or boolean(ancestor::text:list-item)">
157                         <value-of select="$NL"/>
158                 </if>
159                 <variable name="list-style" 
160                         select="key('list-style-ref',ancestor::text:list[boolean(@text:style-name)][1]/@text:style-name)"/>
161                 <call-template name="mk-list-token">
162                         <with-param name="list-style" select="$list-style"/>
163                         <with-param name="level" select="count(ancestor::text:list)"/>
164                 </call-template>
165                 <text> </text>
166                 <apply-templates/>
167                 <if test="position() = last() and not(boolean(ancestor::text:list-item))">
168                         <value-of select="$NL"/>
169                         <value-of select="$NL"/>
170                 </if>
171         </template>
172         
173         <template name="mk-list-token">
174                 <param name="list-style"/>
175                 <param name="level"/>
176                 
177                 <if test="$level &gt; 1">
178                         <call-template name="mk-list-token">
179                                 <with-param name="list-style" select="$list-style"/>
180                                 <with-param name="level" select="$level - 1"/>
181                         </call-template>
182                 </if>
183
184                 <variable name="number-style" select="$list-style/text:list-level-style-number[@text:level=$level]"/>
185                 <variable name="bullet-style" select="$list-style/text:list-level-style-bullet[@text:level=$level]"/>
186                 <choose>
187                         <when test="boolean($number-style)">
188                                 <choose>
189                                         <when test="string-length($number-style/@style:num-format) &gt; 0">
190                                                 <text>#</text>
191                                         </when>
192                                         <otherwise>
193                                                 <text>:</text>
194                                         </otherwise>
195                                 </choose>
196                         </when>
197                         <when test="boolean($bullet-style)">
198                                 <text>*</text>
199                         </when>
200                 </choose>
201         </template>
202
203
204         <!-- 
205                 == Headings ==
206         -->
207
208         <template match="text:h">
209                 <if test="string-length(.) &gt; 0">
210                         <variable name="token">
211                                 <call-template name="mk-heading-prefix">
212                                         <with-param name="level" select="1 + @text:outline-level"/>
213                                 </call-template>
214                         </variable>
215                         <value-of select="$token"/>
216                         <text> </text>
217                         <apply-templates/>
218                         <text> </text>
219                         <value-of select="$token"/>
220                         <text>&#10;</text>
221                 </if>
222         </template>
223
224         <!-- 
225                 Function generating a wiki heading prefix.
226                 
227                 @param level
228                         The heading level. The value must be between 1 and 5.
229         -->
230         <template name="mk-heading-prefix">
231                 <param name="level"/>
232                 <choose>
233                         <when test="$level &gt; 6">
234                                 <call-template name="mk-heading-prefix">
235                                         <with-param name="level" select="6"/>
236                                 </call-template>
237                         </when>
238                         <when test="$level &gt; 0">
239                                 <text>=</text>
240                                 <call-template name="mk-heading-prefix">
241                                         <with-param name="level" select="$level - 1"/>
242                                 </call-template>
243                         </when>
244                 </choose>
245         </template>
246
247         <!-- 
248                 Function generating a token consisting of the given character 
249                 repeated 'level' times.
250                 
251                 @param level
252                         The lengh of the result.
253                 @param char
254                         The character that should be repeated 'level' times.
255         -->
256         <template name="mk-token">
257                 <param name="level"/>
258                 <param name="char"/>
259                 <if test="$level &gt; 0">
260                         <value-of select="$char"/>
261                         <call-template name="mk-token">
262                                 <with-param name="level" select="$level - 1"/>
263                                 <with-param name="char" select="$char"/>
264                         </call-template>
265                 </if>
266         </template>
267         
268         
269         <!-- 
270                 == Tables ==
271          -->
272
273         <template match="table:table">
274                 <text>&#10;</text>
275                 <text>{| class="bordered"</text>
276                 <text>&#10;</text>
277                 <text>|-</text>
278                 <text>&#10;</text>
279                 <apply-templates/>
280                 <text>&#10;</text>
281                 <text>|}</text>
282                 <text>&#10;</text>
283         </template>
284
285         <template match="table:table-header-rows">
286                 <apply-templates/>
287         </template>
288
289         <template match="table:table-row[position() &lt; last()] | table:table-header-rows/table:table-row">
290                 <apply-templates/>
291                 <text>&#10;</text>
292                 <text>|-</text>
293                 <text>&#10;</text>
294         </template>
295
296         <template match="table:table-row">
297                 <apply-templates/>
298         </template>
299
300         <template match="table:table-header-rows//table:table-cell">
301                 <text>! </text>
302                 <if test="@table:number-columns-spanned">
303                         <text>colspan="</text>
304                         <value-of select="@table:number-columns-spanned"/>
305                         <text>" | </text>
306                 </if>
307                 <apply-templates/>
308                 <value-of select="$NL"/>
309         </template>
310
311         <template match="table:table-cell">
312                 <text>| </text>
313                 <if test="@table:number-columns-spanned">
314                         <text>colspan="</text>
315                         <value-of select="@table:number-columns-spanned"/>
316                         <text>" | </text>
317                 </if>
318                 <apply-templates/>
319                 <value-of select="$NL"/>
320         </template>
321
322
323         <!-- 
324                 == WikiMath == 
325          -->
326
327         <template match="text:span[@text:style-name='WikiMath']">
328                 <value-of select="'&lt;math&gt;'"/>
329                 <apply-templates/>
330                 <value-of select="'&lt;/math&gt;'"/>
331         </template>
332
333
334         <!-- 
335                 == Native links == 
336          -->
337
338         <template match="text:a">
339                 <variable name="link-ref" select="@xlink:href"/>
340                 <choose>
341                         <when test="string-length($link-ref) &gt; 0">
342                                 <variable name="link-label" select="string(.)"/>
343                                 <text>[</text>
344                                 <value-of select="$link-ref"/>
345                                 <text> </text>
346                                 <value-of select="$link-label"/>
347                                 <text>]</text>
348                         </when>
349                         
350                         <otherwise>
351                                 <apply-templates/>
352                         </otherwise>
353                 </choose>
354         </template>
355
356
357         <!-- 
358                 == WikiLink == 
359          -->
360
361         <template match="text:span[@text:style-name='WikiLink']">
362                 <value-of select="'[['"/>
363                 <variable name="link-def" select="string(.)"/>
364                 <variable name="link-label" select="normalize-space(substring-before($link-def, '['))"/>
365                 <variable name="link-ref" select="normalize-space(substring-before(substring-after($link-def, '['), ']'))"/>
366                 <choose>
367                         <when test="boolean($link-ref)">
368                         <value-of select="concat($link-ref, '|', $link-label)"/>
369                 </when>
370                 <otherwise>
371                         <value-of select="$link-def"/>
372                 </otherwise>
373                 </choose>
374                 <value-of select="']]'"/>
375         </template>
376         
377         
378         <!-- 
379                 == Paragraphs == 
380          -->
381
382         <template match="text:p[string-length(.) &gt; 0]">
383                 <variable name="style">
384                         <call-template name="mk-style-set">
385                                 <with-param name="node" select="."/>
386                         </call-template>
387                 </variable>
388
389                 <variable name="code" 
390                         select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
391                 <variable name="center" 
392                         select="($style mod (2 * $CENTER_BIT)) - ($style mod ($CENTER_BIT)) != 0"/>
393                 <variable name="right" 
394                         select="($style mod (2 * $RIGHT_BIT)) - ($style mod ($RIGHT_BIT)) != 0"/>
395                 
396                 <choose>
397                         <when test="$center">
398                                 <text>&lt;div align="center"&gt;</text>
399                         </when>
400                         <when test="$right">
401                                 <text>&lt;div align="right"&gt;</text>
402                         </when>
403                         <when test="$code">
404                                 <value-of select="' '"/>
405                         </when>
406                 </choose>
407         
408                 <apply-templates/>
409
410                 <choose>
411                         <when test="$center">
412                                 <text>&lt;/div&gt;</text>
413                         </when>
414                         <when test="$right">
415                                 <text>&lt;/div&gt;</text>
416                         </when>
417                 </choose>
418
419                 <variable name="paragraph-right" 
420                         select="./following-sibling::text:p[1]"/>
421
422                 <if test="boolean($paragraph-right)">
423                         <!-- 
424                                 Insert end of line only if not within a list. Within wiki lists, 
425                                 a line break leaves the current list item. 
426                         -->
427                         <choose>
428                                 <when test="boolean(ancestor::text:list-item)">
429                                         <text> \\ </text>
430                                 </when>
431                                 <when test="$code">
432                                         <variable name="style-right">
433                                                 <call-template name="mk-style-set">
434                                                         <with-param name="node" select="$paragraph-right"/>
435                                                 </call-template>
436                                         </variable>
437                         
438                                         <variable name="code-right" 
439                                                 select="($style-right mod (2 * $CODE_BIT)) - ($style-right mod ($CODE_BIT)) != 0"/>
440                                 
441                                         <value-of select="$NL"/>
442                                         <if test="$code-right">
443                                                 <value-of select="' '"/>
444                                         </if>
445                                         <value-of select="$NL"/>
446                                 </when>
447                                 <otherwise>
448                                         <value-of select="$NL"/>
449                                         <value-of select="$NL"/>
450                                 </otherwise>
451                         </choose>
452                 </if>
453         </template>
454
455         <template match="text:p[string-length(.) = 0 and string-length(preceding-sibling::text:p[1]) &gt; 0]">
456                 <value-of select="$NL"/>
457         </template>
458
459
460         <!-- 
461                 == Preformatted text == 
462         -->
463         
464         <template match="text:s">
465                 <variable name="style">
466                         <call-template name="mk-style-set">
467                                 <with-param name="node" select="."/>
468                         </call-template>
469                 </variable>
470
471                 <variable name="code" 
472                         select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
473                 
474                 <if test="$code">
475                         <choose>
476                                 <when test="@text:c">
477                                         <call-template name="mk-token">
478                                                 <with-param name="level" select="@text:c"/>
479                                                 <with-param name="char" select="' '"/>
480                                         </call-template>
481                                 </when>
482                                 <otherwise>
483                                         <value-of select="' '"/>
484                                 </otherwise>
485                         </choose>
486                 </if>
487         </template>
488         
489         <template match="text:line-break">
490                 <variable name="style">
491                         <call-template name="mk-style-set">
492                                 <with-param name="node" select="."/>
493                         </call-template>
494                 </variable>
495
496                 <variable name="code" 
497                         select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
498                 
499                 <if test="$code">
500                         <value-of select="$NL"/>
501                         <value-of select="' '"/>
502                 </if>
503         </template>
504
505         <!-- 
506                 Footnotes
507         -->
508         
509         <template match="text:note-body">
510                 <variable name="note" select="./parent::text:note"/>
511                 
512                 <if test="$note/@text:note-class = 'footnote'">
513                         <text>&lt;ref name="</text>
514                         <value-of select="$note/@text:id"/>
515                         <text>"&gt;</text>
516                         <apply-templates/>
517                         <text>&lt;/ref&gt;</text>
518                 </if>
519         </template>
520         
521         <template match="text:note-ref[@text:note-class='footnote']">
522                 <text>&lt;ref name="</text>
523                 <value-of select="@text:ref-name"/>
524                 <text>"/&gt;</text>
525         </template>
526         
527          
528         <!-- 
529                 == Images == 
530         -->
531         
532         <template match="draw:text-box[boolean(.//draw:image)]">
533                 <variable name="image" select=".//draw:image[1]"/>
534                 
535                 <variable name="image-description">
536                         <apply-templates/>
537                 </variable>
538                 
539                 <text>[[</text>
540                 <call-template name="mk-image-name">
541                         <with-param name="image" select="$image"/>
542                 </call-template>
543                 <text>|thumb|</text>
544                 <value-of select="normalize-space($image-description)"/>
545                 <text>]]</text>
546         </template>
547         
548         <template match="draw:image[not(boolean(ancestor::draw:text-box))]">
549                 <text>[[</text>
550                 <call-template name="mk-image-name">
551                         <with-param name="image" select="."/>
552                 </call-template>
553                 <text>]]</text>
554         </template>
555
556         <template name="mk-image-name">
557                 <param name="image"/>
558                 
559                 <variable name="base-name">
560                         <call-template name="mk-base-name">
561                                 <with-param name="href" select="$image/@xlink:href"/>
562                         </call-template>
563                 </variable>
564                 
565                 <if test="not(starts-with($base-name, 'Image:'))">
566                         <value-of select="'Image:'"/>
567                 </if>
568                 <value-of select="$base-name"/>
569         </template>     
570         
571         <template name="mk-base-name">
572                 <param name="href"/>
573                 
574                 <variable name="result" select="substring-after($href, '/')"/>
575                 <choose>
576                         <when test="boolean($result)">
577                                 <call-template name="mk-base-name">
578                                         <with-param name="href" select="$result"/>
579                                 </call-template>
580                         </when>
581                         <otherwise>
582                                 <value-of select="$href"/>
583                         </otherwise>
584                 </choose>
585         </template>
586         
587         
588         <!-- 
589                 References
590          -->
591          
592         <!-- TODO: text:bibliography-mark -->
593
594         <template match="text:reference-ref">
595                 <variable name="reference-mark" select="key('reference-resolution', @text:ref-name)"/>
596                 
597                 <choose>
598                         <when test="boolean($reference-mark)">
599                                 <!-- 
600                                         In wiki syntax, only a local reference to a heading can be inserted. 
601                                         If the link target is a descendant of a heading element, a link can be
602                                         inserted in the result. -->
603                                 <variable name="header-anchor" select="$reference-mark/ancestor::text:h[1]"/>
604                                 <if test="boolean($header-anchor)">
605                                         <text>[[#</text>
606                                         <value-of select="string($header-anchor)"/>
607                                         <text>|</text>
608                                 </if>
609                                 
610                                 <variable name="reference-text" select="string(.)"/>
611                                 
612                                 <choose>
613                                         <!-- Check, whether the reference text is cached in the document. -->
614                                         <when test="string-length($reference-text) &gt; 0">
615                                                 <value-of select="$reference-text"/>
616                                         </when>
617                                         
618                                         <otherwise>
619                                                 <!-- 
620                                                         TODO: Evaluate the @text:reference-format attribute and 
621                                                         generate the replacement text (difficult).-->
622                                                 <text>(REFERENCE TEXT UNAVAILABLE: "</text>
623                                                 <value-of select="@text:ref-name"/>
624                                                 <text>")</text>
625                                         </otherwise>
626                                 </choose>
627                                 
628                                 <if test="boolean($header-anchor)">
629                                         <text>]]</text>
630                                 </if>
631                         </when>
632
633                         <otherwise>
634                                 <text>(UNDEFINED REFERENCE: "</text>
635                                 <value-of select="@text:ref-name"/>
636                                 <text>")</text>
637                         </otherwise>
638                 </choose>
639         </template>
640         
641         <template match="text:reference-mark">
642                 <!-- TODO: Output an anchor. -->
643                 <apply-templates/>
644         </template>
645
646         <template match="text:reference-mark-start">
647                 <!-- TODO: Output an anchor. -->
648         </template>
649
650         <!-- 
651                 == Plain text == 
652         -->
653         
654         <template match="text:p/text() | text:h/text() | text:span/text() | text:sequence/text() | text:sequence-ref/text() | text:a/text() | text:bookmark-ref/text() | text:reference-mark/text()">
655                 <choose>
656                         <when test="boolean(./ancestor::table:table-header-rows | ./ancestor::text:h)">
657                                 <!-- 
658                                         No explicit styles within table headings or section headings, 
659                                         because those styles are consistently declared by the Wiki engine. -->
660                                 <value-of select="."/>
661                         </when>
662                         
663                         <when test="string-length(.) &gt; 0">
664                                 <variable name="style">
665                                         <call-template name="mk-style-set">
666                                                 <with-param name="node" select="."/>
667                                         </call-template>
668                                 </variable>
669                                 
670                                 <variable name="current-paragraph" 
671                                         select="./ancestor::text:p[1]"/>
672                                 <variable name="paragraph-id" 
673                                         select="generate-id($current-paragraph)"/>
674                                 <variable name="frames" 
675                                         select="$current-paragraph/descendant::draw:frame"/>
676                                 <variable name="frame-count" 
677                                         select="count($frames)"/>
678                                         
679                                 <!-- 
680                                         The current style context consists of all text nodes that are 
681                                         descendants of the paragraph ancestor of this text node but not 
682                                         descendants of any frame nodes that are descendants of the current 
683                                         text nodes paragraph.
684                                  -->
685                                 <variable name="context" 
686                                         select="$current-paragraph//text()[not(boolean(./ancestor::draw:frame[1]) and count(./ancestor::draw:frame[1] | $frames) = $frame-count)]"/>
687                                 <variable name="context-size" select="count($context)"/>
688
689                                 <variable name="context-index">
690                                         <call-template name="mk-context-index">
691                                                 <with-param name="current-id" select="generate-id(.)"/>
692                                                 <with-param name="context" select="$context"/>
693                                                 <with-param name="test-index" select="1"/>
694                                         </call-template>
695                                 </variable>
696
697                                 <variable name="style-left">
698                                         <choose>
699                                                 <when test="$context-index &gt; 1">
700                                                         <variable name="left" select="$context[$context-index - 1]"/>
701                                                         <!-- 
702                                                                 The preceding text node is a child of this nodes topmost 
703                                                                 styled ancestor. This means that the result of the 
704                                                                 transformation will be directly concatenated. 
705                                                                 -->
706                                                         <call-template name="mk-style-set">
707                                                                 <with-param name="node" select="$left"/>
708                                                         </call-template>
709                                                 </when>
710                                                 <otherwise>
711                                                         <value-of select="$NO_STYLE"/>
712                                                 </otherwise>
713                                         </choose>
714                                 </variable>
715                                 <variable name="style-right">
716                                         <choose>
717                                                 <when test="$context-index &lt; count($context)">
718                                                         <variable name="right" select="$context[$context-index + 1]"/>
719                                                         <!-- 
720                                                                 The preceding text node is a child of this nodes topmost 
721                                                                 styled ancestor. This means that the result of the 
722                                                                 transformation will be directly concatenated. 
723                                                                 -->
724                                                         <call-template name="mk-style-set">
725                                                                 <with-param name="node" select="$right"/>
726                                                         </call-template>
727                                                 </when>
728                                                 <otherwise>
729                                                         <value-of select="$NO_STYLE"/>
730                                                 </otherwise>
731                                         </choose>
732                                 </variable>
733
734                                 <variable name="bold" 
735                                         select="($style mod (2 * $BOLD_BIT)) != 0"/>
736                                 <variable name="italic" 
737                                         select="($style mod (2 * $ITALIC_BIT)) - ($style mod ($ITALIC_BIT)) != 0"/>
738                                 <variable name="superscript" 
739                                         select="($style mod (2 * $SUPERSCRIPT_BIT)) - ($style mod ($SUPERSCRIPT_BIT)) != 0"/>
740                                 <variable name="subscript" 
741                                         select="($style mod (2 * $SUBSCRIPT_BIT)) - ($style mod ($SUBSCRIPT_BIT)) != 0"/>
742                                 <variable name="code" 
743                                         select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
744                                 <variable name="typewriter" 
745                                         select="($style mod (2 * $TYPEWRITER_BIT)) - ($style mod ($TYPEWRITER_BIT)) != 0"/>
746
747                                 <variable name="bold-left" 
748                                         select="($style-left mod (2 * $BOLD_BIT)) != 0"/>
749                                 <variable name="italic-left" 
750                                         select="($style-left mod (2 * $ITALIC_BIT)) - ($style-left mod ($ITALIC_BIT)) != 0"/>
751                                 <variable name="superscript-left" 
752                                         select="($style-left mod (2 * $SUPERSCRIPT_BIT)) - ($style-left mod ($SUPERSCRIPT_BIT)) != 0"/>
753                                 <variable name="subscript-left" 
754                                         select="($style-left mod (2 * $SUBSCRIPT_BIT)) - ($style-left mod ($SUBSCRIPT_BIT)) != 0"/>
755                                 <variable name="typewriter-left" 
756                                         select="($style-left mod (2 * $TYPEWRITER_BIT)) - ($style-left mod ($TYPEWRITER_BIT)) != 0"/>
757
758                                 <variable name="bold-right" 
759                                         select="($style-right mod (2 * $BOLD_BIT)) != 0"/>
760                                 <variable name="italic-right" 
761                                         select="($style-right mod (2 * $ITALIC_BIT)) - ($style-right mod ($ITALIC_BIT)) != 0"/>
762                                 <variable name="superscript-right" 
763                                         select="($style-right mod (2 * $SUPERSCRIPT_BIT)) - ($style-right mod ($SUPERSCRIPT_BIT)) != 0"/>
764                                 <variable name="subscript-right" 
765                                         select="($style-right mod (2 * $SUBSCRIPT_BIT)) - ($style-right mod ($SUBSCRIPT_BIT)) != 0"/>
766                                 <variable name="typewriter-right" 
767                                         select="($style-right mod (2 * $TYPEWRITER_BIT)) - ($style-right mod ($TYPEWRITER_BIT)) != 0"/>
768
769                                 <!-- Debugging: Add style infos to the output. -->
770                                 <!-- 
771                                 <value-of select="'{'"/>
772                                 <value-of select="$style-left"/>
773                                 <value-of select="'-'"/>
774                                 <value-of select="$style"/>
775                                 <value-of select="','"/>
776                                 <value-of select="$context-size"/>
777                                 <value-of select="'}'"/>
778                                  -->
779
780                                 <if test="$superscript and not($superscript-left)">
781                                         <text>^^</text>
782                                 </if>
783                                 <if test="$subscript and not($subscript-left)">
784                                         <text>,,</text>
785                                 </if>
786                                 <if test="not($code) and $typewriter and not($typewriter-left)">
787                                         <text>##</text>
788                                 </if>
789                                 <if test="$bold and not($bold-left)">
790                                         <text>**</text>
791                                 </if>
792                                 <if test="$italic and not($italic-left)">
793                                         <text>//</text>
794                                 </if>
795
796                                 <call-template name="render-quoted-text">
797                                         <with-param name="text" select="."/>
798                                 </call-template>
799
800                                 <if test="$italic and not($italic-right)">
801                                         <text>//</text>
802                                 </if>
803                                 <if test="$bold and not($bold-right)">
804                                         <text>**</text>
805                                 </if>
806                                 <if test="not($code) and $typewriter and not($typewriter-right)">
807                                         <text>##</text>
808                                 </if>
809                                 <if test="$subscript and not($subscript-right)">
810                                         <text>,,</text>
811                                 </if>
812                                 <if test="$superscript and not($superscript-right)">
813                                         <text>^^</text>
814                                 </if>
815
816                                 <!-- Debugging: Add style details to the output. -->
817                                 <!-- 
818                                 <value-of select="'{'"/>
819                                 <value-of select="$style"/>
820                                 <value-of select="'-'"/>
821                                 <value-of select="$style-right"/>
822                                 <value-of select="'}'"/>
823                                  -->
824
825                         </when>
826                 </choose>
827         </template>
828
829         <!-- 
830                 Function for looking up the position of a node identified by the given 
831                 'current-id' within a node set 'context'. 
832                 
833                 The search starts with the the index 'test-index'. The search is recursive 
834                 in the 'test-index' argument. To save recursion depth, each recursive call 
835                 iteratively tests a fixed number of indexes (by loop unrolling).
836          -->
837         <template name="mk-context-index">
838                 <param name="current-id"/>
839                 <param name="context"/>
840                 <param name="test-index"/>
841                 
842                 <variable name="context-size" select="count($context)"/>
843                 
844                 <choose>
845                         <when test="context-size &lt; $test-index">
846                         </when>
847                         <when test="$current-id = generate-id($context[$test-index])">
848                                 <value-of select="$test-index"/>
849                         </when>
850                         <when test="context-size &lt; ($test-index + 1)">
851                         </when>
852                         <when test="$current-id = generate-id($context[$test-index + 1])">
853                                 <value-of select="$test-index + 1"/>
854                         </when>
855                         <when test="context-size &lt; ($test-index + 2)">
856                         </when>
857                         <when test="$current-id = generate-id($context[$test-index + 2])">
858                                 <value-of select="$test-index + 2"/>
859                         </when>
860                         <when test="context-size &lt; ($test-index + 3)">
861                         </when>
862                         <when test="$current-id = generate-id($context[$test-index + 3])">
863                                 <value-of select="$test-index + 3"/>
864                         </when>
865                         <when test="context-size &lt; ($test-index + 4)">
866                         </when>
867                         <when test="$current-id = generate-id($context[$test-index + 4])">
868                                 <value-of select="$test-index + 4"/>
869                         </when>
870                         <when test="context-size &lt; ($test-index + 5)">
871                         </when>
872                         <when test="$current-id = generate-id($context[$test-index + 5])">
873                                 <value-of select="$test-index + 5"/>
874                         </when>
875                         <when test="context-size &lt; ($test-index + 6)">
876                         </when>
877                         <otherwise>
878                                 <call-template name="mk-context-index">
879                                         <with-param name="current-id" select="$current-id"/>
880                                         <with-param name="context" select="$context"/>
881                                         <with-param name="test-index" select="$test-index + 6"/>
882                                 </call-template>
883                         </otherwise>
884                 </choose>
885         </template>
886         
887         <template name="render-quoted-text">
888                 <param name="text"/>
889                 
890                 <choose>
891                         <when test="contains($text, '&lt;') or contains($text, '[') or starts-with($text, '----') or starts-with($text, '=') or starts-with($text, '*')  or starts-with($text, ';')  or starts-with($text, '#')">
892                                 <text>&lt;nowiki&gt;</text>
893                                 <choose>
894                                         <when test="contains($text, '&lt;/nowiki&gt;')">
895                                                 <call-template name="render-escaped-text">
896                                                         <with-param name="text" select="$text"/>
897                                                 </call-template>
898                                         </when>
899                                         <otherwise>
900                                                 <value-of select="$text"/>
901                                         </otherwise>
902                                 </choose>
903                                 <text>&lt;/nowiki&gt;</text>                    
904                         </when>
905                         <otherwise>
906                                 <value-of select="$text"/>
907                         </otherwise>
908                 </choose>
909         </template>
910
911         <template name="render-escaped-text">
912                 <param name="text"/>
913                 
914                 <choose>
915                         <when test="contains($text, '&lt;')">
916                                 <value-of select="substring-before($text, '&lt;')"/>
917                                 <value-of select="'&amp;'"/>
918                                 <value-of select="'lt;'"/>
919                                 <value-of select="substring-after($text, '&lt;')"/>
920                         </when>
921                         <otherwise>
922                                 <value-of select="$text"/>
923                         </otherwise>
924                 </choose>
925         </template>
926
927         <!-- 
928                 == Wiki styles: bold, italics, ... == 
929          -->
930
931         <template name="mk-style-set">
932                 <param name="node"/>
933                 
934                 <variable 
935                         name="context" 
936                         select="$node/ancestor-or-self::*[@text:style-name][1]"
937                 />
938                 
939                 <choose>
940                         <when test="boolean($context)">
941                                 <variable 
942                                         name="style" 
943                                         select="key('style-ref', $context/@text:style-name)"
944                                 />
945
946                                 <!-- Debugging: Print inspected styles. -->                             
947                                 <!-- 
948                                 <message>
949                                         <value-of select="'=== '"/>
950                                         <value-of select="$style/@style:name"/>
951                                         <value-of select="' ==='"/>
952                                 </message>
953                                  -->
954                 
955                                 <call-template name="mk-style-set-internal">
956                                         <with-param name="node" select="$context"/>
957                                         <with-param name="style" select="$style"/>
958                                         <with-param name="style-set" select="$NO_STYLE"/>
959                                         <with-param name="style-mask" select="$NO_STYLE"/>
960                                 </call-template>
961                         </when>
962                         <otherwise>
963                                 <value-of select="$NO_STYLE"/>
964                         </otherwise>
965                 </choose>
966         </template>
967         
968         <!-- 
969                 Compute the wiki style set that corresponds 
970                 to the given office style at the given context node. 
971                 
972                 @param node
973                         A node in which context the style is computed. If neither the given style 
974                         nor one of its linked styles does specify a style of the given type, 
975                         ancestor nodes of the given context node are considered.
976                 @param style
977                         A style:style element node. The style of the requested type is searched
978                         in the given style and its linked styles. 
979                 @style-set
980                         A bit set of styles already defined by the context.
981                 @style-mask
982                         A bit set of styles that must not be taken from the currently inspected 
983                         style, because those styles are already defined by the context.
984                         
985                 @return A bit set composed of the wiki style constants.
986         -->
987         <template name="mk-style-set-internal">
988                 <param name="node"/>
989                 <param name="style"/>
990                 <param name="style-set"/>
991                 <param name="style-mask"/>
992                 
993                 <variable name="text-properties" select="$style/style:text-properties"/>
994                 
995                 <!-- Decompose style-mask into individual bits. -->
996                 <variable name="bold-requested" 
997                         select="($style-mask mod (2 * $BOLD_BIT)) = 0"/>
998                 <variable name="italic-requested" 
999                         select="($style-mask mod (2 * $ITALIC_BIT)) - ($style-mask mod ($ITALIC_BIT)) = 0"/>
1000                 <variable name="superscript-requested" 
1001                         select="($style-mask mod (2 * $SUPERSCRIPT_BIT)) - ($style-mask mod ($SUPERSCRIPT_BIT)) = 0"/>
1002                 <variable name="subscript-requested" 
1003                         select="($style-mask mod (2 * $SUBSCRIPT_BIT)) - ($style-mask mod ($SUBSCRIPT_BIT)) = 0"/>
1004                 <variable name="typewriter-requested" 
1005                         select="($style-mask mod (2 * $TYPEWRITER_BIT)) - ($style-mask mod ($TYPEWRITER_BIT)) = 0"/>
1006                 <variable name="code-requested" 
1007                         select="($style-mask mod (2 * $CODE_BIT)) - ($style-mask mod ($CODE_BIT)) = 0"/>
1008                 <variable name="center-requested" 
1009                         select="($style-mask mod (2 * $CENTER_BIT)) - ($style-mask mod ($CENTER_BIT)) = 0"/>
1010                 <variable name="right-requested" 
1011                         select="($style-mask mod (2 * $RIGHT_BIT)) - ($style-mask mod ($RIGHT_BIT)) = 0"/>
1012                 
1013                 <!-- Extract styles that are not already defined by the context. -->
1014                 <variable name="bold-style">
1015                         <choose>
1016                                 <when test="$bold-requested and boolean($text-properties/@fo:font-weight='bold')">
1017                                         <!-- Bold found in current style. -->
1018                                         <value-of select="$BOLD_BIT"/>
1019                                 </when>
1020                                 <otherwise>
1021                                         <value-of select="$NO_STYLE"/>
1022                                 </otherwise>
1023                         </choose>
1024                 </variable>
1025                 <variable name="bold-mask">
1026                         <choose>
1027                                 <when test="$bold-requested and boolean($text-properties/@fo:font-weight)">
1028                                         <!-- 
1029                                                 Other value than "bold" means that the character style is not 
1030                                                 bold and no parent style must be considered.
1031                                         -->
1032                                         <value-of select="$BOLD_BIT"/>
1033                                 </when>
1034                                 <otherwise>
1035                                         <value-of select="$NO_STYLE"/>
1036                                 </otherwise>
1037                         </choose>
1038                 </variable>
1039                 
1040                 <variable name="italic-style">
1041                         <choose>
1042                                 <when test="$italic-requested and boolean($text-properties/@fo:font-style='italic')">
1043                                         <!-- Italic found in current style. -->
1044                                         <value-of select="$ITALIC_BIT"/>
1045                                 </when>
1046                                 <otherwise>
1047                                         <value-of select="$NO_STYLE"/>
1048                                 </otherwise>
1049                         </choose>
1050                 </variable>
1051                 <variable name="italic-mask">
1052                         <choose>
1053                                 <when test="$italic-requested and boolean($text-properties/@fo:font-style)">
1054                                         <!-- 
1055                                                 Other value than "italic" means that the character style is not 
1056                                                 italic and no parent style must be considered.
1057                                         -->
1058                                         <value-of select="$ITALIC_BIT"/>
1059                                 </when>
1060                                 <otherwise>
1061                                         <value-of select="$NO_STYLE"/>
1062                                 </otherwise>
1063                         </choose>
1064                 </variable>
1065
1066                 <variable name="superscript-style">
1067                         <choose>
1068                                 <when test="$superscript-requested and contains($text-properties/@style:text-position, 'super')">
1069                                         <value-of select="$SUPERSCRIPT_BIT"/>
1070                                 </when>
1071                                 <otherwise>
1072                                         <value-of select="$NO_STYLE"/>
1073                                 </otherwise>
1074                         </choose>
1075                 </variable>
1076                 <variable name="superscript-mask">
1077                         <choose>
1078                                 <when test="$superscript-requested and boolean($text-properties/@style:text-position)">
1079                                         <value-of select="$SUPERSCRIPT_BIT"/>
1080                                 </when>
1081                                 <otherwise>
1082                                         <value-of select="$NO_STYLE"/>
1083                                 </otherwise>
1084                         </choose>
1085                 </variable>
1086
1087                 <variable name="subscript-style">
1088                         <choose>
1089                                 <when test="$subscript-requested and contains($text-properties/@style:text-position, 'sub')">
1090                                         <value-of select="$SUBSCRIPT_BIT"/>
1091                                 </when>
1092                                 <otherwise>
1093                                         <value-of select="$NO_STYLE"/>
1094                                 </otherwise>
1095                         </choose>
1096                 </variable>
1097                 <variable name="subscript-mask">
1098                         <choose>
1099                                 <when test="$subscript-requested and boolean($text-properties/@style:text-position)">
1100                                         <value-of select="$SUBSCRIPT_BIT"/>
1101                                 </when>
1102                                 <otherwise>
1103                                         <value-of select="$NO_STYLE"/>
1104                                 </otherwise>
1105                         </choose>
1106                 </variable>
1107
1108                 <variable name="typewriter-style">
1109                         <choose>
1110                                 <when test="$typewriter-requested and ($style/@style:family='text') and boolean($text-properties/@style:font-name)">
1111                                         <variable name="font-face" 
1112                                                 select="key('font-face-ref', $text-properties/@style:font-name)"/>
1113                                         <choose>
1114                                                 <when test="$font-face/@style:font-pitch='fixed'">
1115                                                         <value-of select="$TYPEWRITER_BIT"/>
1116                                                 </when>
1117                                                 <otherwise>
1118                                                         <value-of select="$NO_STYLE"/>
1119                                                 </otherwise>
1120                                         </choose>
1121                                 </when>
1122                                 <otherwise>
1123                                         <value-of select="$NO_STYLE"/>
1124                                 </otherwise>
1125                         </choose>
1126                 </variable>
1127                 <variable name="typewriter-mask">
1128                         <choose>
1129                                 <!-- Note: Suppress the typewriter style on text within a code paragraph. -->
1130                                 <when test="$typewriter-requested and boolean($text-properties/@style:font-name)">
1131                                         <value-of select="$TYPEWRITER_BIT"/>
1132                                 </when>
1133                                 <otherwise>
1134                                         <value-of select="$NO_STYLE"/>
1135                                 </otherwise>
1136                         </choose>
1137                 </variable>
1138
1139                 <variable name="code-style">
1140                         <choose>
1141                                 <when test="$code-requested and ($style/@style:family='paragraph') and boolean($text-properties/@style:font-name)">
1142                                         <variable name="font-face" 
1143                                                 select="key('font-face-ref', $text-properties/@style:font-name)"/>
1144                                         <choose>
1145                                                 <when test="$font-face/@style:font-pitch='fixed'">
1146                                                         <value-of select="$CODE_BIT"/>
1147                                                 </when>
1148                                                 <otherwise>
1149                                                         <value-of select="$NO_STYLE"/>
1150                                                 </otherwise>
1151                                         </choose>
1152                                 </when>
1153                                 <otherwise>
1154                                         <value-of select="$NO_STYLE"/>
1155                                 </otherwise>
1156                         </choose>
1157                 </variable>
1158                 <variable name="code-mask">
1159                         <choose>
1160                                 <when test="$code-requested and ($style/@style:family='paragraph') and boolean($text-properties/@style:font-name)">
1161                                         <value-of select="$CODE_BIT"/>
1162                                 </when>
1163                                 <otherwise>
1164                                         <value-of select="$NO_STYLE"/>
1165                                 </otherwise>
1166                         </choose>
1167                 </variable>
1168                 
1169                 <variable name="center-style">
1170                         <choose>
1171                                 <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align='center')">
1172                                         <value-of select="$CENTER_BIT"/>
1173                                 </when>
1174                                 <otherwise>
1175                                         <value-of select="$NO_STYLE"/>
1176                                 </otherwise>
1177                         </choose>
1178                 </variable>
1179                 <variable name="center-mask">
1180                         <choose>
1181                                 <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align)">
1182                                         <value-of select="$CENTER_BIT"/>
1183                                 </when>
1184                                 <otherwise>
1185                                         <value-of select="$NO_STYLE"/>
1186                                 </otherwise>
1187                         </choose>
1188                 </variable>
1189
1190                 <variable name="right-style">
1191                         <choose>
1192                                 <when test="$right-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align='end')">
1193                                         <value-of select="$RIGHT_BIT"/>
1194                                 </when>
1195                                 <otherwise>
1196                                         <value-of select="$NO_STYLE"/>
1197                                 </otherwise>
1198                         </choose>
1199                 </variable>
1200                 <variable name="right-mask">
1201                         <choose>
1202                                 <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align)">
1203                                         <value-of select="$RIGHT_BIT"/>
1204                                 </when>
1205                                 <otherwise>
1206                                         <value-of select="$NO_STYLE"/>
1207                                 </otherwise>
1208                         </choose>
1209                 </variable>
1210                 
1211
1212                 <!-- Compute the updated styles and mask. -->
1213                 <!-- 
1214                         Note: The bit masks style-mask, bold-style, italic-style,... are 
1215                         guaranteed to be disjoint, therefore, addition can be use instead 
1216                         of bitwise or (which is missing in XPath). -->
1217                 <variable name="updated-style" 
1218                         select="$style-set + $bold-style + $italic-style + $superscript-style + $subscript-style + $code-style + $typewriter-style + $center-style + $right-style"/>
1219                 <variable name="updated-mask" 
1220                         select="$style-mask + $bold-mask + $italic-mask + $superscript-mask + $subscript-mask + $code-mask + $typewriter-mask + $center-mask + $right-mask"/>
1221
1222                 <!-- Inspect linked and nested styles. -->
1223                 <choose>
1224                         <when test="boolean($style/@style:parent-style-name)">
1225                                 <!-- Look through the style, the current style is based on. -->
1226                                 <call-template name="mk-style-set-internal">
1227                                         <with-param name="node" select="$node"/>
1228                                         <with-param name="style" select="key('style-ref', $style/@style:parent-style-name)"/>
1229                                         <with-param name="style-set" select="$updated-style"/>
1230                                         <with-param name="style-mask" select="$updated-mask"/>
1231                                 </call-template>
1232                         </when>
1233                         <otherwise>
1234                                 <variable name="ancestors" select="$node/ancestor::*[@text:style-name][1]"/>
1235                                 
1236                                 <!-- Debugging: Print currently inspected style.  -->
1237                                 <!-- 
1238                                 <message>
1239                                         <value-of select="'{'"/>
1240                                         <value-of select="$style/@style:name"/>
1241                                         <value-of select="','"/>
1242                                         <value-of select="$updated-style"/>
1243                                         <value-of select="','"/>
1244                                         <value-of select="$updated-mask"/>
1245                                         <value-of select="','"/>
1246                                         <value-of select="local-name($ancestors)"/>
1247                                         <value-of select="',('"/>
1248                                         <value-of select="$node"/>
1249                                         <value-of select="')'"/>
1250                                         <value-of select="'}'"/>
1251                                 </message>
1252                                  -->
1253                                  
1254                                 <!-- 
1255                                         If there is an ancestor that has a style, use that style, 
1256                                         otherwise, a style is not found. -->
1257                                 <choose>
1258                                         <when test="boolean($ancestors)">
1259                                                 <!-- Look through the style of the nearest ancestor that has a style. -->
1260                                                 <call-template name="mk-style-set-internal">
1261                                                         <with-param name="node" select="$ancestors"/>
1262                                                         <with-param name="style" select="key('style-ref', $ancestors/@text:style-name)"/>
1263                                                         <with-param name="style-set" select="$updated-style"/>
1264                                                         <with-param name="style-mask" select="$updated-mask"/>
1265                                                 </call-template>
1266                                         </when>
1267                                         <otherwise>
1268                                                 <!-- No more styles to inspect. Return the result. -->
1269                                                 <value-of select="$updated-style"/>
1270                                         </otherwise>
1271                                 </choose>
1272                         </otherwise>
1273                 </choose>
1274         </template>
1275
1276
1277         <!-- 
1278                 == Descending the tree == 
1279         -->
1280
1281         <template match="/">
1282                 <apply-templates/>
1283                 <value-of select="$NL"/>
1284                 <if test="boolean(//text:note[@text:note-class='footnote'])">
1285                         <value-of select="$NL"/>
1286                         <text>----</text>
1287                         <value-of select="$NL"/>
1288                         <text>&lt;references/&gt;</text>
1289                         <value-of select="$NL"/>
1290                 </if>
1291         </template>
1292         
1293         <template match="office:document-content">
1294                 <apply-templates/>
1295         </template>
1296
1297         <template match="office:body">
1298                 <apply-templates/>
1299         </template>
1300
1301         <template match="office:* | text:* | draw:frame | draw:text-box | draw:frame | draw:a">
1302                 <apply-templates/>
1303         </template>
1304
1305         <template match="node()">
1306         </template>
1307 </stylesheet>
1308
1309 <!--
1310   Local Variables:
1311         tab-width: 4
1312         sgml-indent-step: 4
1313   End:
1314 -->