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