Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / docx / from / textruns / textruns.xsl @ 187

History | View | Annotate | Download (31.2 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
3
		xmlns:html="http://www.w3.org/1999/xhtml"
4
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
                xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
6
                xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
7
                xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
8
                xmlns:dc="http://purl.org/dc/elements/1.1/"
9
                xmlns:dcterms="http://purl.org/dc/terms/"
10
                xmlns:dcmitype="http://purl.org/dc/dcmitype/"
11
                xmlns:iso="http://www.iso.org/ns/1.0"
12
                xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
13
                xmlns:mml="http://www.w3.org/1998/Math/MathML"
14
                xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main"
15
                xmlns:mv="urn:schemas-microsoft-com:mac:vml"
16
                xmlns:o="urn:schemas-microsoft-com:office:office"
17
                xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
18
                xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
19
                xmlns:rel="http://schemas.openxmlformats.org/package/2006/relationships"
20
                xmlns:tbx="http://www.lisa.org/TBX-Specification.33.0.html"
21
                xmlns:tei="http://www.tei-c.org/ns/1.0"
22
                xmlns:teidocx="http://www.tei-c.org/ns/teidocx/1.0"
23
                xmlns:v="urn:schemas-microsoft-com:vml"
24
                xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006"
25
                xmlns:w10="urn:schemas-microsoft-com:office:word"
26
                xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
27
                xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
28
                xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
29
                xmlns="http://www.tei-c.org/ns/1.0"
30
                version="2.0"
31
                exclude-result-prefixes="a cp dc dcterms dcmitype prop    html iso m mml mo mv o pic r rel     tbx tei teidocx v xs ve w10 w wne wp">
32
    
33
    
34
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
35
      <desc>
36
         <p> TEI stylesheet for converting Word docx files to TEI </p>
37
         <p>This software is dual-licensed:
38

    
39
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
40
Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
41

    
42
2. http://www.opensource.org/licenses/BSD-2-Clause
43
		
44
All rights reserved.
45

    
46
Redistribution and use in source and binary forms, with or without
47
modification, are permitted provided that the following conditions are
48
met:
49

    
50
* Redistributions of source code must retain the above copyright
51
notice, this list of conditions and the following disclaimer.
52

    
53
* Redistributions in binary form must reproduce the above copyright
54
notice, this list of conditions and the following disclaimer in the
55
documentation and/or other materials provided with the distribution.
56

    
57
This software is provided by the copyright holders and contributors
58
"as is" and any express or implied warranties, including, but not
59
limited to, the implied warranties of merchantability and fitness for
60
a particular purpose are disclaimed. In no event shall the copyright
61
holder or contributors be liable for any direct, indirect, incidental,
62
special, exemplary, or consequential damages (including, but not
63
limited to, procurement of substitute goods or services; loss of use,
64
data, or profits; or business interruption) however caused and on any
65
theory of liability, whether in contract, strict liability, or tort
66
(including negligence or otherwise) arising in any way out of the use
67
of this software, even if advised of the possibility of such damage.
68
</p>
69
         <p>Author: See AUTHORS</p>
70
         <p>Id: $Id: textruns.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
71
         <p>Copyright: 2008, TEI Consortium</p>
72
      </desc>
73
   </doc>
74
    
75
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
76
      <desc>Processing an inline run of text with its styling</desc>
77
   </doc>
78

    
79
    <xsl:template match="w:commentReference">
80
      <xsl:variable name="commentN" select="@w:id"/>
81
      <xsl:for-each
82
	  select="document(concat($wordDirectory,'/word/comments.xml'))/w:comments/w:comment[@w:id=$commentN]">
83
	<note place="comment" resp="{translate(@w:author,' ','_')}">
84
	  <date when="{@w:date}"/>
85
	  <xsl:apply-templates/>
86
	</note>
87
      </xsl:for-each>
88
    </xsl:template>
89

    
90
    <xsl:template match="w:r">
91
      <xsl:call-template name="processTextrun"/>
92
    </xsl:template>
93

    
94

    
95
   <xsl:template name="processTextrun">
96
     <xsl:variable name="style">
97
       <xsl:value-of select="w:rPr/w:rStyle/@w:val"/>
98
     </xsl:variable>
99
     <xsl:choose>
100
       <xsl:when test="$style='CommentReference'">
101
	   <xsl:apply-templates/>
102
       </xsl:when>
103

    
104
       <xsl:when test="$style='mentioned'">
105
	 <mentioned>
106
	   <xsl:apply-templates/>
107
	 </mentioned>
108
       </xsl:when>
109

    
110
       <xsl:when test="$style='Hyperlink' and ancestor::w:hyperlink">
111
	 <xsl:call-template name="basicStyles"/>
112
       </xsl:when>
113

    
114
       <xsl:when test="$style='Hyperlink' and ancestor::w:fldSimple">
115
	 <xsl:call-template name="basicStyles"/>
116
       </xsl:when>
117
       
118
       <xsl:when test="$style='Hyperlink' and preceding-sibling::w:r[w:instrText][1]/w:instrText">
119
	 <ref>
120
	   <xsl:attribute name="target">
121
	     <xsl:for-each
122
		 select="preceding-sibling::w:r[w:instrText][1]/w:instrText">
123
	       <xsl:value-of select="substring-before(substring-after(.,'&#x0022;'),'&#x0022;')"/>
124
	     </xsl:for-each>
125
	   </xsl:attribute>
126
	   <xsl:call-template name="basicStyles"/>
127
	 </ref>
128
       </xsl:when>
129
       
130
       <xsl:when test="$style='ref'">
131
	 <ref>
132
	   <xsl:apply-templates/>
133
	 </ref>
134
       </xsl:when>
135
       
136
       <xsl:when test="$style='date'">
137
	 <date>
138
	   <xsl:apply-templates/>
139
	 </date>
140
       </xsl:when>
141
       
142
       <xsl:when test="$style='orgName'">
143
	 <orgName>
144
	   <xsl:apply-templates/>
145
	 </orgName>
146
       </xsl:when>
147
       
148
       <xsl:when test="not($style='')">
149
	 <hi rend="{replace($style,' ','_')}">
150
	   <xsl:apply-templates/>
151
	 </hi>
152
       </xsl:when>
153
       
154
       <xsl:otherwise>
155
	 <xsl:call-template name="basicStyles"/>
156
       </xsl:otherwise>
157
       
158
     </xsl:choose>
159
        
160
   </xsl:template>
161
    
162
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
163
      <desc>If there is no special style defined, look at the Word
164
      underlying basic formatting. We can ignore the run's font change if 
165
      a) it's not a special para AND the font is the ISO default, OR 
166
      b) the font for the run is the same as its parent paragraph.
167
      </desc>
168
   </doc>
169
    <xsl:template name="basicStyles">
170

    
171
      <xsl:variable name="styles">
172
	<xsl:if test="w:rPr/w:rFonts//@w:ascii">
173
	  <xsl:if test="(not(matches(parent::w:p/w:pPr/w:pStyle/@w:val,'Special')) and not(matches(w:rPr/w:rFonts/@w:ascii,'Calibri'))) or
174
			not(w:rPr/w:rFonts/@w:ascii = parent::w:p/w:pPr/w:rPr/w:rFonts/@w:ascii)">
175
	    <xsl:if test="$preserveEffects='true'">
176
	      <s n="font-family">
177
		<xsl:value-of select="w:rPr/w:rFonts/@w:ascii"/>
178
	      </s>
179
	    </xsl:if>
180
	    <!-- w:ascii="Courier New" w:hAnsi="Courier New" w:cs="Courier New" -->
181
	    <!-- what do we want to do about cs (Complex Scripts), hAnsi (high ANSI), eastAsia etc? -->
182
	  </xsl:if>
183
	</xsl:if>
184
	<xsl:if test="w:rPr/w:sz">
185
	  <s n="font-size">
186
	    <xsl:value-of select="number(w:rPr/w:sz/@w:val) div 2"/>
187
	    <xsl:text>pt</xsl:text>
188
	  </s>
189
	</xsl:if>
190
	<xsl:if test="w:rPr/w:position/@w:val and not(w:rPr/w:position/@w:val='0')">
191
	  <s n="position">
192
	    <xsl:value-of select="w:rPr/w:position/@w:val"/>
193
	  </s>
194
	</xsl:if>
195
      </xsl:variable>
196

    
197
      <xsl:variable name="dir">
198
	<!-- right-to-left text -->
199
	<xsl:if test="w:rPr/w:rtl or parent::w:p/w:pPr/w:rPr/w:rtl">
200
	  <xsl:text>rtl</xsl:text>
201
	</xsl:if>
202
      </xsl:variable>
203
     
204
      <xsl:variable name="effects">
205
	<xsl:if test="w:rPr/w:position[number(@w:val)&lt;-2]">
206
	  <n>subscript</n>
207
	</xsl:if>
208
	
209
	<xsl:if test="w:rPr/w:i">
210
	  <n>italic</n>
211
	</xsl:if>
212

    
213
	<xsl:choose>
214
	  <xsl:when test="w:rPr/w:b/@w:val='0'">
215
	    <n>normalweight</n>
216
	  </xsl:when>
217
	  <xsl:when test="w:rPr/w:b">
218
	    <n>bold</n>
219
	  </xsl:when>
220
	</xsl:choose>
221

    
222
	<xsl:if test="w:rPr/w:position[number(@w:val)&gt;2]">
223
	  <n>superscript</n>
224
	</xsl:if>
225

    
226
	<xsl:if test="w:rPr/w:vertAlign">
227
	  <n>
228
	    <xsl:value-of select="w:rPr/w:vertAlign/@w:val"/>
229
	  </n>
230
	</xsl:if>
231

    
232
	<xsl:if test="w:rPr/w:strike">
233
	  <n>strikethrough</n>
234
	</xsl:if>
235

    
236
	<xsl:if test="w:rPr/w:dstrike">
237
	  <n>strikedoublethrough</n>
238
	</xsl:if>
239

    
240
	<xsl:if test="w:rPr/w:u[@w:val='single']">
241
	  <n>underline</n>
242
	</xsl:if>
243

    
244
	<xsl:if test="w:rPr/w:u[@w:val='wave']">
245
	  <n>underwavyline</n>
246
	</xsl:if>
247

    
248
	<xsl:if test="w:rPr/w:u[@w:val='double']">
249
	  <n>underdoubleline</n>
250
	</xsl:if>
251

    
252
	<xsl:if test="w:rPr/w:smallCaps">
253
	  <n>smallcaps</n>
254
	</xsl:if>
255

    
256
	<xsl:if test="w:rPr/w:caps">
257
	  <n>capsall</n>
258
	</xsl:if>
259

    
260
	<xsl:if test="w:rPr/w:color and
261
		      not(w:rPr/w:color/@w:val='000000' or w:rPr/w:color/@w:val='auto')">
262
	  <n>
263
	    <xsl:text>color(</xsl:text>
264
	    <xsl:value-of select="w:rPr/w:color/@w:val"/>
265
	    <xsl:text>)</xsl:text>
266
	  </n>
267
	</xsl:if>
268

    
269
	<xsl:if test="w:rPr/w:highlight">
270
	  <n>
271
	    <xsl:text>background(</xsl:text>
272
	    <xsl:value-of select="w:rPr/w:highlight/@w:val"/>
273
	    <xsl:text>)</xsl:text>
274
	  </n>
275
	</xsl:if>
276
		
277
      </xsl:variable>
278

    
279
	<xsl:choose>
280
	<xsl:when test="$effects/* or ($styles/* and $preserveEffects='true')">
281
	  <hi>
282
	    <xsl:if test="$dir!='' and $preserveEffects='true'">
283
	      <xsl:attribute name="dir"
284
			     xmlns="http://www.w3.org/2005/11/its"
285
			     select="$dir"/>
286
	    </xsl:if>
287
	    <xsl:choose>
288
	      <xsl:when test="$effects/*">
289
		<xsl:attribute name="rend">
290
		  <xsl:for-each select="$effects/*">
291
		    <xsl:value-of select="."/>
292
		    <xsl:if test="following-sibling::*">
293
		      <xsl:text> </xsl:text>
294
		    </xsl:if>
295
		  </xsl:for-each>
296
		</xsl:attribute>
297
	      </xsl:when>
298
	      <xsl:when test="$preserveEffects='true'">
299
		<xsl:attribute name="rend">
300
		  <xsl:text>isoStyle</xsl:text>
301
		</xsl:attribute>
302
	      </xsl:when>
303
	    </xsl:choose>
304
	    <xsl:if test="$styles/* and $preserveEffects='true'">
305
	      <xsl:attribute name="html:style">
306
		<xsl:for-each select="$styles/*">
307
		  <xsl:value-of select="@n"/>
308
		  <xsl:text>:</xsl:text>
309
		  <xsl:value-of select="."/>
310
		  <xsl:text>;</xsl:text>
311
		</xsl:for-each>
312
	      </xsl:attribute>
313
	    </xsl:if>
314
	    <xsl:apply-templates/>
315
	  </hi>
316
	</xsl:when>
317
	<xsl:otherwise>
318
	  <xsl:apply-templates/>
319
	</xsl:otherwise> 
320
      </xsl:choose>
321
    </xsl:template>
322
    
323
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
324
      <desc>
325
        Handle Text, Comments, Tabs, Symbols etc. 
326
    </desc>
327
   </doc>
328
    <xsl:template match="w:t">
329
        <xsl:variable name="t">
330
            <xsl:choose>
331
                <xsl:when test="@xml:space='preserve' and string-length(normalize-space(.))=0">
332
                    <seg><xsl:text> </xsl:text></seg>
333
                </xsl:when>
334
                <xsl:when test="@xml:space='preserve'">
335
                    <xsl:value-of select="."/>
336
                </xsl:when>
337
                <xsl:otherwise>
338
                    <xsl:value-of select="normalize-space(.)"/>
339
                </xsl:otherwise>
340
            </xsl:choose>
341
        </xsl:variable>
342
        <xsl:choose>
343
            <xsl:when test="parent::w:r/w:rPr/w:rFonts[starts-with(@w:ascii,'ISO')]">
344
                <seg html:style="font-family:{parent::w:r/w:rPr/w:rFonts/@w:ascii};">
345
                    <xsl:value-of select="$t"/>
346
                </seg>
347
            </xsl:when>
348
            <xsl:otherwise>
349
                <xsl:copy-of select="$t"/>
350
            </xsl:otherwise>
351
            
352
        </xsl:choose>
353
    </xsl:template>
354
    
355
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
356
      <desc>
357
        Convert special characters (w:syms) into Unicode characters or
358
	<gi>g</gi> elements. Symbol to Unicode mapping from http://unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt
359
    </desc>
360
   </doc>
361
    <xsl:template match="w:sym">
362
      <xsl:choose>
363
	<xsl:when test="@w:font='Symbol' or @w:font='MT Symbol'">
364
	  <xsl:choose>
365
<xsl:when test="@w:char='F022'">&#x2200;</xsl:when><!--	# FOR ALL # universal -->
366
<xsl:when test="@w:char='F024'">&#x2203;</xsl:when><!--	# THERE EXISTS # existential -->
367
<xsl:when test="@w:char='F025'">&#x0025;</xsl:when><!--	# PERCENT SIGN # percent -->
368
<xsl:when test="@w:char='F026'">&#x0026;</xsl:when><!--	# AMPERSAND # ampersand -->
369
<xsl:when test="@w:char='F027'">&#x220B;</xsl:when><!--	# CONTAINS AS MEMBER	# suchthat -->
370
<xsl:when test="@w:char='F028'">&#x0028;</xsl:when><!--	# LEFT PARENTHESIS	# parenleft -->
371
<xsl:when test="@w:char='F029'">&#x0029;</xsl:when><!--	# RIGHT PARENTHESIS	# parenright -->
372
<xsl:when test="@w:char='F02A'">&#x2217;</xsl:when><!--	# ASTERISK OPERATOR	# asteriskmath -->
373
<xsl:when test="@w:char='F02B'">&#x002B;</xsl:when><!--	# PLUS SIGN # plus -->
374
<xsl:when test="@w:char='F02C'">&#x002C;</xsl:when><!--	# COMMA	# comma -->
375
<xsl:when test="@w:char='F02D'">&#x2212;</xsl:when><!--	# MINUS SIGN # minus -->
376
<xsl:when test="@w:char='F02E'">&#x002E;</xsl:when><!--	# FULL STOP # period -->
377
<xsl:when test="@w:char='F02F'">&#x002F;</xsl:when><!--	# SOLIDUS # slash -->
378
<xsl:when test="@w:char='F030'">&#x0030;</xsl:when>
379
<xsl:when test="@w:char='F031'">&#x0031;</xsl:when><!--	# DIGIT ONE # one -->
380
<xsl:when test="@w:char='F032'">&#x0032;</xsl:when><!--	# DIGIT TWO # two -->
381
<xsl:when test="@w:char='F033'">&#x0033;</xsl:when><!--	# DIGIT THREE # three -->
382
<xsl:when test="@w:char='F034'">&#x0034;</xsl:when><!--	# DIGIT FOUR # four -->
383
<xsl:when test="@w:char='F035'">&#x0035;</xsl:when><!--	# DIGIT FIVE # five -->
384
<xsl:when test="@w:char='F036'">&#x0036;</xsl:when><!--	# DIGIT SIX # six -->
385
<xsl:when test="@w:char='F037'">&#x0037;</xsl:when><!--	# DIGIT SEVEN # seven -->
386
<xsl:when test="@w:char='F038'">&#x0038;</xsl:when>
387
<xsl:when test="@w:char='F039'">&#x0039;</xsl:when><!--	# DIGIT NINE # nine -->
388
<xsl:when test="@w:char='F03A'">&#x003A;</xsl:when><!--	# COLON	# colon -->
389
<xsl:when test="@w:char='F03B'">&#x003B;</xsl:when><!--	# SEMICOLON # semicolon -->
390
<xsl:when test="@w:char='F03C'">&#x003C;</xsl:when><!--	# LESS-THAN SIGN	# less -->
391
<xsl:when test="@w:char='F03D'">&#x003D;</xsl:when><!--	# EQUALS SIGN # equal -->
392
<xsl:when test="@w:char='F03E'">&#x003E;</xsl:when><!--	# GREATER-THAN SIGN	# greater -->
393
<xsl:when test="@w:char='F03F'">&#x003F;</xsl:when><!--	# QUESTION MARK	# question -->
394
<xsl:when test="@w:char='F040'">&#x2245;</xsl:when><!--	# APPROXIMATELY EQUAL TO	# congruent -->
395
<xsl:when test="@w:char='F041'">&#x0391;</xsl:when><!--	# GREEK CAPITAL LETTER ALPHA	# Alpha -->
396
<xsl:when test="@w:char='F042'">&#x0392;</xsl:when><!--	# GREEK CAPITAL LETTER BETA	# Beta -->
397
<xsl:when test="@w:char='F043'">&#x03A7;</xsl:when><!--	# GREEK CAPITAL LETTER CHI	# Chi -->
398
<xsl:when test="@w:char='F044'">&#x0394;</xsl:when><!--	# GREEK CAPITAL LETTER DELTA	# Delta -->
399
<xsl:when test="@w:char='F044'">&#x2206;</xsl:when><!--	# INCREMENT # Delta -->
400
<xsl:when test="@w:char='F045'">&#x0395;</xsl:when><!--	# GREEK CAPITAL LETTER EPSILON	# Epsilon -->
401
<xsl:when test="@w:char='F046'">&#x03A6;</xsl:when><!--	# GREEK CAPITAL LETTER PHI	# Phi -->
402
<xsl:when test="@w:char='F047'">&#x0393;</xsl:when><!--	# GREEK CAPITAL LETTER GAMMA	# Gamma -->
403
<xsl:when test="@w:char='F048'">&#x0397;</xsl:when><!--	# GREEK CAPITAL LETTER ETA	# Eta -->
404
<xsl:when test="@w:char='F049'">&#x0399;</xsl:when><!--	# GREEK CAPITAL LETTER IOTA	# Iota -->
405
<xsl:when test="@w:char='F04A'">&#x03D1;</xsl:when><!--	# GREEK THETA SYMBOL	# theta1 -->
406
<xsl:when test="@w:char='F04B'">&#x039A;</xsl:when><!--	# GREEK CAPITAL LETTER KAPPA	# Kappa -->
407
<xsl:when test="@w:char='F04C'">&#x039B;</xsl:when><!--	# GREEK CAPITAL LETTER LAMDA	# Lambda -->
408
<xsl:when test="@w:char='F04D'">&#x039C;</xsl:when><!--	# GREEK CAPITAL LETTER MU	# Mu -->
409
<xsl:when test="@w:char='F04E'">&#x039D;</xsl:when><!--	# GREEK CAPITAL LETTER NU	# Nu -->
410
<xsl:when test="@w:char='F04F'">&#x039F;</xsl:when><!--	# GREEK CAPITAL LETTER OMICRON	# Omicron -->
411
<xsl:when test="@w:char='F050'">&#x03A0;</xsl:when><!--	# GREEK CAPITAL LETTER PI	# Pi -->
412
<xsl:when test="@w:char='F051'">&#x0398;</xsl:when><!--	# GREEK CAPITAL LETTER THETA	# Theta -->
413
<xsl:when test="@w:char='F052'">&#x03A1;</xsl:when><!--	# GREEK CAPITAL LETTER RHO	# Rho -->
414
<xsl:when test="@w:char='F053'">&#x03A3;</xsl:when><!--	# GREEK CAPITAL LETTER SIGMA	# Sigma -->
415
<xsl:when test="@w:char='F054'">&#x03A4;</xsl:when><!--	# GREEK CAPITAL LETTER TAU	# Tau -->
416
<xsl:when test="@w:char='F055'">&#x03A5;</xsl:when><!--	# GREEK CAPITAL LETTER UPSILON	# Upsilon -->
417
<xsl:when test="@w:char='F056'">&#x03C2;</xsl:when>
418
<xsl:when test="@w:char='F057'">&#x03A9;</xsl:when><!--	# GREEK CAPITAL LETTER OMEGA	# Omega -->
419
<xsl:when test="@w:char='F057'">&#x2126;</xsl:when><!--	# OHM SIGN # Omega -->
420
<xsl:when test="@w:char='F058'">&#x039E;</xsl:when><!--	# GREEK CAPITAL LETTER XI	# Xi -->
421
<xsl:when test="@w:char='F059'">&#x03A8;</xsl:when><!--	# GREEK CAPITAL LETTER PSI	# Psi -->
422
<xsl:when test="@w:char='F05A'">&#x0396;</xsl:when><!--	# GREEK CAPITAL LETTER ZETA	# Zeta -->
423
<xsl:when test="@w:char='F05B'">&#x005B;</xsl:when><!--	# LEFT SQUARE BRACKET	# bracketleft -->
424
<xsl:when test="@w:char='F05C'">&#x2234;</xsl:when><!--	# THEREFORE # therefore -->
425
<xsl:when test="@w:char='F05D'">&#x005D;</xsl:when><!--	# RIGHT SQUARE BRACKET	# bracketright -->
426
<xsl:when test="@w:char='F05E'">&#x22A5;</xsl:when><!--	# UP TACK # perpendicular -->
427
<xsl:when test="@w:char='F05F'">&#x005F;</xsl:when><!--	# LOW LINE # underscore -->
428
<xsl:when test="@w:char='F060'">&#xF8E5;</xsl:when><!--	# RADICAL EXTENDER	# radicalex (CUS) -->
429
<xsl:when test="@w:char='F061'">&#x03B1;</xsl:when><!--	# GREEK SMALL LETTER ALPHA	# alpha -->
430
<xsl:when test="@w:char='F062'">&#x03B2;</xsl:when><!--	# GREEK SMALL LETTER BETA	# beta -->
431
<xsl:when test="@w:char='F063'">&#x03C7;</xsl:when><!--	# GREEK SMALL LETTER CHI	# chi -->
432
<xsl:when test="@w:char='F064'">&#x03B4;</xsl:when><!--	# GREEK SMALL LETTER DELTA	# delta -->
433
<xsl:when test="@w:char='F065'">&#x03B5;</xsl:when><!--	# GREEK SMALL LETTER EPSILON	# epsilon -->
434
<xsl:when test="@w:char='F066'">&#x03C6;</xsl:when><!--	# GREEK SMALL LETTER PHI	# phi -->
435
<xsl:when test="@w:char='F067'">&#x03B3;</xsl:when><!--	# GREEK SMALL LETTER GAMMA	# gamma -->
436
<xsl:when test="@w:char='F068'">&#x03B7;</xsl:when><!--	# GREEK SMALL LETTER ETA	# eta -->
437
<xsl:when test="@w:char='F069'">&#x03B9;</xsl:when><!--	# GREEK SMALL LETTER IOTA	# iota -->
438
<xsl:when test="@w:char='F06A'">&#x03D5;</xsl:when><!--	# GREEK PHI SYMBOL	# phi1 -->
439
<xsl:when test="@w:char='F06B'">&#x03BA;</xsl:when><!--	# GREEK SMALL LETTER KAPPA	# kappa -->
440
<xsl:when test="@w:char='F06C'">&#x03BB;</xsl:when><!--	# GREEK SMALL LETTER LAMDA	# lambda -->
441
<xsl:when test="@w:char='F06D'">&#x00B5;</xsl:when><!--	# MICRO SIGN # mu -->
442
<xsl:when test="@w:char='F06D'">&#x03BC;</xsl:when><!--	# GREEK SMALL LETTER MU	# mu -->
443
<xsl:when test="@w:char='F06E'">&#x03BD;</xsl:when><!--	# GREEK SMALL LETTER NU	# nu -->
444
<xsl:when test="@w:char='F06F'">&#x03BF;</xsl:when><!--	# GREEK SMALL LETTER OMICRON	# omicron -->
445
<xsl:when test="@w:char='F070'">&#x03C0;</xsl:when><!--	# GREEK SMALL LETTER PI	# pi -->
446
<xsl:when test="@w:char='F071'">&#x03B8;</xsl:when>
447
<xsl:when test="@w:char='F072'">&#x03C1;</xsl:when><!--	# GREEK SMALL LETTER RHO	# rho -->
448
<xsl:when test="@w:char='F073'">&#x03C3;</xsl:when><!--	# GREEK SMALL LETTER SIGMA	# sigma -->
449
<xsl:when test="@w:char='F074'">&#x03C4;</xsl:when><!--	# GREEK SMALL LETTER TAU	# tau -->
450
<xsl:when test="@w:char='F075'">&#x03C5;</xsl:when><!--	# GREEK SMALL LETTER UPSILON	# upsilon -->
451
<xsl:when test="@w:char='F076'">&#x03D6;</xsl:when><!--	# GREEK PI SYMBOL	# omega1 -->
452
<xsl:when test="@w:char='F077'">&#x03C9;</xsl:when><!--	# GREEK SMALL LETTER OMEGA	# omega -->
453
<xsl:when test="@w:char='F078'">&#x03BE;</xsl:when><!--	# GREEK SMALL LETTER XI	# xi -->
454
<xsl:when test="@w:char='F079'">&#x03C8;</xsl:when><!--	# GREEK SMALL LETTER PSI	# psi -->
455
<xsl:when test="@w:char='F07A'">&#x03B6;</xsl:when><!--	# GREEK SMALL LETTER ZETA	# zeta -->
456
<xsl:when test="@w:char='F07B'">&#x007B;</xsl:when><!--	# LEFT CURLY BRACKET	# braceleft -->
457
<xsl:when test="@w:char='F07C'">&#x007C;</xsl:when><!--	# VERTICAL LINE	# bar -->
458
<xsl:when test="@w:char='F07D'">&#x007D;</xsl:when><!--	# RIGHT CURLY BRACKET	# braceright -->
459
<xsl:when test="@w:char='F07E'">&#x223C;</xsl:when><!--	# TILDE OPERATOR	# similar -->
460
<xsl:when test="@w:char='F0A0'">&#x20AC;</xsl:when><!--	# EURO SIGN # Euro -->
461
<xsl:when test="@w:char='F0A1'">&#x03D2;</xsl:when><!--	# GREEK UPSILON WITH HOOK SYMBOL	# Upsilon1 -->
462
<xsl:when test="@w:char='F0A2'">&#x2032;</xsl:when><!--	# PRIME	# minute -->
463
<xsl:when test="@w:char='F0A3'">&#x2264;</xsl:when><!--	# LESS-THAN OR EQUAL TO	# lessequal -->
464
<xsl:when test="@w:char='F0A4'">&#x2044;</xsl:when><!--	# FRACTION SLASH	# fraction -->
465
<xsl:when test="@w:char='F0A4'">&#x2215;</xsl:when><!--	# DIVISION SLASH	# fraction -->
466
<xsl:when test="@w:char='F0A5'">&#x221E;</xsl:when><!--	# INFINITY # infinity -->
467
<xsl:when test="@w:char='F0A6'">&#x0192;</xsl:when><!--	# LATIN SMALL LETTER F WITH HOOK	# florin -->
468
<xsl:when test="@w:char='F0A7'">&#x2663;</xsl:when><!--	# BLACK CLUB SUIT	# club -->
469
<xsl:when test="@w:char='F0A8'">&#x2666;</xsl:when><!--	# BLACK DIAMOND SUIT	# diamond -->
470
<xsl:when test="@w:char='F0A9'">&#x2665;</xsl:when><!--	# BLACK HEART SUIT	# heart -->
471
<xsl:when test="@w:char='F0AA'">&#x2660;</xsl:when><!--	# BLACK SPADE SUIT	# spade -->
472
<xsl:when test="@w:char='F0AB'">&#x2194;</xsl:when><!--	# LEFT RIGHT ARROW	# arrowboth -->
473
<xsl:when test="@w:char='F0AC'">&#x2190;</xsl:when><!--	# LEFTWARDS ARROW	# arrowleft -->
474
<xsl:when test="@w:char='F0AD'">&#x2191;</xsl:when><!--	# UPWARDS ARROW	# arrowup -->
475
<xsl:when test="@w:char='F0AE'">&#x2192;</xsl:when><!--	# RIGHTWARDS ARROW	# arrowright -->
476
<xsl:when test="@w:char='F0AF'">&#x2193;</xsl:when><!--	# DOWNWARDS ARROW	# arrowdown -->
477
<xsl:when test="@w:char='F0B0'">&#x00B0;</xsl:when><!--	# DEGREE SIGN # degree -->
478
<xsl:when test="@w:char='F0B1'">&#x00B1;</xsl:when><!--	# PLUS-MINUS SIGN	# plusminus -->
479
<xsl:when test="@w:char='F0B2'">&#x2033;</xsl:when><!--	# DOUBLE PRIME # second -->
480
<xsl:when test="@w:char='F0B3'">&#x2265;</xsl:when><!--	# GREATER-THAN OR EQUAL TO	# greaterequal -->
481
<xsl:when test="@w:char='F0B4'">&#x00D7;</xsl:when><!--	# MULTIPLICATION SIGN	# multiply -->
482
<xsl:when test="@w:char='F0B5'">&#x221D;</xsl:when><!--	# PROPORTIONAL TO	# proportional -->
483
<xsl:when test="@w:char='F0B6'">&#x2202;</xsl:when><!--	# PARTIAL DIFFERENTIAL	# partialdiff -->
484
<xsl:when test="@w:char='F0B7'">&#x2022;</xsl:when><!--	# BULLET # bullet -->
485
<xsl:when test="@w:char='F0B8'">&#x00F7;</xsl:when><!--	# DIVISION SIGN	# divide -->
486
<xsl:when test="@w:char='F0B9'">&#x2260;</xsl:when><!--	# NOT EQUAL TO # notequal -->
487
<xsl:when test="@w:char='F0BA'">&#x2261;</xsl:when><!--	# IDENTICAL TO # equivalence -->
488
<xsl:when test="@w:char='F0BB'">&#x2248;</xsl:when><!--	# ALMOST EQUAL TO	# approxequal -->
489
<xsl:when test="@w:char='F0BC'">&#x2026;</xsl:when><!--	# HORIZONTAL ELLIPSIS	# ellipsis -->
490
<xsl:when test="@w:char='F0BD'">&#xF8E6;</xsl:when><!--	# VERTICAL ARROW EXTENDER	# arrowvertex (CUS) -->
491
<xsl:when test="@w:char='F0BE'">&#xF8E7;</xsl:when><!--	# HORIZONTAL ARROW EXTENDER	# arrowhorizex (CUS) -->
492
<xsl:when test="@w:char='F0BF'">&#x21B5;</xsl:when><!--	# DOWNWARDS ARROW WITH CORNER LEFTWARDS	# carriagereturn -->
493
<xsl:when test="@w:char='F0C0'">&#x2135;</xsl:when><!--	# ALEF SYMBOL # aleph -->
494
<xsl:when test="@w:char='F0C1'">&#x2111;</xsl:when><!--	# BLACK-LETTER CAPITAL I	# Ifraktur -->
495
<xsl:when test="@w:char='F0C2'">&#x211C;</xsl:when><!--	# BLACK-LETTER CAPITAL R	# Rfraktur -->
496
<xsl:when test="@w:char='F0C3'">&#x2118;</xsl:when><!--	# SCRIPT CAPITAL P	# weierstrass -->
497
<xsl:when test="@w:char='F0C4'">&#x2297;</xsl:when><!--	# CIRCLED TIMES	# circlemultiply -->
498
<xsl:when test="@w:char='F0C5'">&#x2295;</xsl:when><!--	# CIRCLED PLUS # circleplus -->
499
<xsl:when test="@w:char='F0C6'">&#x2205;</xsl:when><!--	# EMPTY SET # emptyset -->
500
<xsl:when test="@w:char='F0C7'">&#x2229;</xsl:when><!--	# INTERSECTION # intersection -->
501
<xsl:when test="@w:char='F0C8'">&#x222A;</xsl:when><!--	# UNION	# union -->
502
<xsl:when test="@w:char='F0C9'">&#x2283;</xsl:when><!--	# SUPERSET OF # propersuperset -->
503
<xsl:when test="@w:char='F0CA'">&#x2287;</xsl:when><!--	# SUPERSET OF OR EQUAL TO	# reflexsuperset -->
504
<xsl:when test="@w:char='F0CB'">&#x2284;</xsl:when><!--	# NOT A SUBSET OF	# notsubset -->
505
<xsl:when test="@w:char='F0CC'">&#x2282;</xsl:when><!--	# SUBSET OF # propersubset -->
506
<xsl:when test="@w:char='F0CD'">&#x2286;</xsl:when><!--	# SUBSET OF OR EQUAL TO	# reflexsubset -->
507
<xsl:when test="@w:char='F0CE'">&#x2208;</xsl:when><!--	# ELEMENT OF # element -->
508
<xsl:when test="@w:char='F0CF'">&#x2209;</xsl:when><!--	# NOT AN ELEMENT OF	# notelement -->
509
<xsl:when test="@w:char='F0D0'">&#x2220;</xsl:when><!--	# ANGLE	# angle -->
510
<xsl:when test="@w:char='F0D1'">&#x2207;</xsl:when><!--	# NABLA	# gradient -->
511
<xsl:when test="@w:char='F0D2'">&#xF6DA;</xsl:when><!--	# REGISTERED SIGN SERIF	# registerserif (CUS) -->
512
<xsl:when test="@w:char='F0D3'">&#xF6D9;</xsl:when><!--	# COPYRIGHT SIGN SERIF	# copyrightserif (CUS) -->
513
<xsl:when test="@w:char='F0D4'">&#xF6DB;</xsl:when><!--	# TRADE MARK SIGN SERIF	# trademarkserif (CUS) -->
514
<xsl:when test="@w:char='F0D5'">&#x220F;</xsl:when><!--	# N-ARY PRODUCT	# product -->
515
<xsl:when test="@w:char='F0D6'">&#x221A;</xsl:when><!--	# SQUARE ROOT # radical -->
516
<xsl:when test="@w:char='F0D7'">&#x22C5;</xsl:when><!--	# DOT OPERATOR # dotmath -->
517
<xsl:when test="@w:char='F0D8'">&#x00AC;</xsl:when><!--	# NOT SIGN # logicalnot -->
518
<xsl:when test="@w:char='F0D9'">&#x2227;</xsl:when><!--	# LOGICAL AND # logicaland -->
519
<xsl:when test="@w:char='F0DA'">&#x2228;</xsl:when><!--	# LOGICAL OR # logicalor -->
520
<xsl:when test="@w:char='F0DB'">&#x21D4;</xsl:when><!--	# LEFT RIGHT DOUBLE ARROW	# arrowdblboth -->
521
<xsl:when test="@w:char='F0DC'">&#x21D0;</xsl:when><!--	# LEFTWARDS DOUBLE ARROW	# arrowdblleft -->
522
<xsl:when test="@w:char='F0DD'">&#x21D1;</xsl:when><!--	# UPWARDS DOUBLE ARROW	# arrowdblup -->
523
<xsl:when test="@w:char='F0DE'">&#x21D2;</xsl:when><!--	# RIGHTWARDS DOUBLE ARROW	# arrowdblright -->
524
<xsl:when test="@w:char='F0DF'">&#x21D3;</xsl:when><!--	# DOWNWARDS DOUBLE ARROW	# arrowdbldown -->
525
<xsl:when test="@w:char='F0E0'">&#x25CA;</xsl:when><!--	# LOZENGE # lozenge -->
526
<xsl:when test="@w:char='F0E1'">&#x2329;</xsl:when><!--	# LEFT-POINTING ANGLE BRACKET	# angleleft -->
527
<xsl:when test="@w:char='F0E2'">&#xF8E8;</xsl:when><!--	# REGISTERED SIGN SANS SERIF	# registersans (CUS) -->
528
<xsl:when test="@w:char='F0E3'">&#xF8E9;</xsl:when><!--	# COPYRIGHT SIGN SANS SERIF	# copyrightsans (CUS) -->
529
<xsl:when test="@w:char='F0E4'">&#xF8EA;</xsl:when><!--	# TRADE MARK SIGN SANS SERIF	# trademarksans (CUS) -->
530
<xsl:when test="@w:char='F0E5'">&#x2211;</xsl:when><!--	# N-ARY SUMMATION	# summation -->
531
<xsl:when test="@w:char='F0E6'">&#xF8EB;</xsl:when><!--	# LEFT PAREN TOP	# parenlefttp (CUS) -->
532
<xsl:when test="@w:char='F0E7'">&#xF8EC;</xsl:when><!--	# LEFT PAREN EXTENDER	# parenleftex (CUS) -->
533
<xsl:when test="@w:char='F0E8'">&#xF8ED;</xsl:when><!--	# LEFT PAREN BOTTOM	# parenleftbt (CUS) -->
534
<xsl:when test="@w:char='F0E9'">&#xF8EE;</xsl:when><!--	# LEFT SQUARE BRACKET TOP	# bracketlefttp (CUS) -->
535
<xsl:when test="@w:char='F0EA'">&#xF8EF;</xsl:when><!--	# LEFT SQUARE BRACKET EXTENDER	# bracketleftex (CUS) -->
536
<xsl:when test="@w:char='F0EB'">&#xF8F0;</xsl:when><!--	# LEFT SQUARE BRACKET BOTTOM	# bracketleftbt (CUS) -->
537
<xsl:when test="@w:char='F0EC'">&#xF8F1;</xsl:when><!--	# LEFT CURLY BRACKET TOP	# bracelefttp (CUS) -->
538
<xsl:when test="@w:char='F0ED'">&#xF8F2;</xsl:when><!--	# LEFT CURLY BRACKET MID	# braceleftmid (CUS) -->
539
<xsl:when test="@w:char='F0EE'">&#xF8F3;</xsl:when><!--	# LEFT CURLY BRACKET BOTTOM	# braceleftbt (CUS) -->
540
<xsl:when test="@w:char='F0EF'">&#xF8F4;</xsl:when><!--	# CURLY BRACKET EXTENDER	# braceex (CUS) -->
541
<xsl:when test="@w:char='F0F1'">&#x232A;</xsl:when><!--	# RIGHT-POINTING ANGLE BRACKET	# angleright -->
542
<xsl:when test="@w:char='F0F2'">&#x222B;</xsl:when><!--	# INTEGRAL # integral -->
543
<xsl:when test="@w:char='F0F3'">&#x2320;</xsl:when><!--	# TOP HALF INTEGRAL	# integraltp -->
544
<xsl:when test="@w:char='F0F4'">&#xF8F5;</xsl:when><!--	# INTEGRAL EXTENDER	# integralex (CUS) -->
545
<xsl:when test="@w:char='F0F5'">&#x2321;</xsl:when><!--	# BOTTOM HALF INTEGRAL	# integralbt -->
546
<xsl:when test="@w:char='F0F6'">&#xF8F6;</xsl:when><!--	# RIGHT PAREN TOP	# parenrighttp (CUS) -->
547
<xsl:when test="@w:char='F0F7'">&#xF8F7;</xsl:when><!--	# RIGHT PAREN EXTENDER	# parenrightex (CUS) -->
548
<xsl:when test="@w:char='F0F8'">&#xF8F8;</xsl:when><!--	# RIGHT PAREN BOTTOM	# parenrightbt (CUS) -->
549
<xsl:when test="@w:char='F0F9'">&#xF8F9;</xsl:when><!--	# RIGHT SQUAREBRACKET TOP	# bracketrighttp (CUS) -->
550
<xsl:when test="@w:char='F0FA'">&#xF8FA;</xsl:when><!--	# RIGHT SQUARE BRACKET EXTENDER	# bracketrightex (CUS) -->
551
<xsl:when test="@w:char='F0FB'">&#xF8FB;</xsl:when><!--	# RIGHT SQUARE BRACKET BOTTOM	# bracketrightbt (CUS) -->
552
<xsl:when test="@w:char='F0FC'">&#xF8FC;</xsl:when><!--	# RIGHT CURLY BRACKET TOP	# bracerighttp (CUS) -->
553
<xsl:when test="@w:char='F0FD'">&#xF8FD;</xsl:when><!--	# RIGHT CURLY BRACKET MID	# bracerightmid (CUS) -->
554
<xsl:when test="@w:char='F0FE'">&#xF8FE;</xsl:when><!--	# RIGHT CURLY BRACKET BOTTOM	# bracerightbt (CUS) -->
555
	<xsl:otherwise> 	  
556
	  <g html:style="font-family:{@w:font};" n="{@w:char}"/>
557
	</xsl:otherwise>       
558
      </xsl:choose> 	
559
    </xsl:when>
560
    <xsl:when test="@w:font='Wingdings 2' and @w:char='F050'">&#x2713;</xsl:when><!-- tick mark-->
561
	<xsl:otherwise> 	  
562
	  <g html:style="font-family:{@w:font};" n="{@w:char}"/>
563
	</xsl:otherwise>       
564
      </xsl:choose>
565
    </xsl:template>     
566
    
567
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
568
      <desc>
569
        handle tabs
570
    </desc>
571
   </doc>
572
    <xsl:template match="w:r/w:tab">
573
      <xsl:text>	</xsl:text>
574
    </xsl:template>
575
    
576
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
577
      <desc>
578
        handle ptabs (absolute position tab character)
579
    </desc>
580
   </doc>
581
    <xsl:template match="w:r/w:ptab">
582
        <c rend="ptab" type="{@w:alignment}">
583
            <xsl:text>	</xsl:text>
584
        </c>
585
    </xsl:template>
586
    
587
    
588
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
589
      <desc>
590
        capture line breaks
591
    </desc>
592
   </doc>
593
    <xsl:template match="w:br">
594
        <xsl:choose>
595
            <xsl:when test="@w:type='page'">
596
                <pb/>
597
            </xsl:when>
598
            <xsl:otherwise>
599
                <lb/>
600
            </xsl:otherwise>
601
        </xsl:choose>
602
    </xsl:template>
603
    
604
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
605
      <desc>
606
        Contains text that has been tracked as a revision. 
607
    </desc>
608
   </doc>
609

    
610
    <xsl:template match="w:del">
611
      <del when="{@w:date}">
612
	<xsl:call-template name="identifyChange">
613
	  <xsl:with-param name="who" select="@w:author"/>
614
	</xsl:call-template>
615
	<xsl:apply-templates/>
616
      </del>
617
    </xsl:template>
618

    
619
    <xsl:template match="w:rPr/w:del"/>
620

    
621
    <xsl:template match="w:delText">
622
      <xsl:apply-templates/>
623
    </xsl:template>
624

    
625
    <xsl:template match="w:ins">
626
      <add when="{@w:date}">
627
	<xsl:call-template name="identifyChange">
628
	   <xsl:with-param name="who" select="@w:author"/>
629
	</xsl:call-template>
630
	<xsl:call-template name="processTextrun"/>
631
      </add>
632
    </xsl:template>
633

    
634
    <xsl:template match="w:rPr/w:ins"/>
635
 
636
    
637
  <xsl:template match="w:noBreakHyphen">
638
    <xsl:text>&#x2011;</xsl:text>
639
  </xsl:template>
640

    
641

    
642

    
643
</xsl:stylesheet>