Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / docx / to / dynamic / dynamic.xsl @ 187

History | View | Annotate | Download (5.9 kB)

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

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

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

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

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

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

    
58
This software is provided by the copyright holders and contributors
59
"as is" and any express or implied warranties, including, but not
60
limited to, the implied warranties of merchantability and fitness for
61
a particular purpose are disclaimed. In no event shall the copyright
62
holder or contributors be liable for any direct, indirect, incidental,
63
special, exemplary, or consequential damages (including, but not
64
limited to, procurement of substitute goods or services; loss of use,
65
data, or profits; or business interruption) however caused and on any
66
theory of liability, whether in contract, strict liability, or tort
67
(including negligence or otherwise) arising in any way out of the use
68
of this software, even if advised of the possibility of such damage.
69
</p>
70
         <p>Author: See AUTHORS</p>
71
         <p>Id: $Id: dynamic.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
72
         <p>Copyright: 2008, TEI Consortium</p>
73
      </desc>
74
   </doc>
75
    
76
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
77
      <desc> 
78
        dynamic content
79
    </desc>
80
   </doc>    
81
    <xsl:template match="tei:dynamicContent">
82
        <xsl:choose>
83
            <xsl:when test="@type='pagenumber'">
84
                <w:fldSimple w:instr=" PAGE \* MERGEFORMAT ">
85
                    <w:r>
86
                        <w:rPr>
87
                            <w:noProof/>
88
                        </w:rPr>
89
                        <w:t>1</w:t>
90
                    </w:r>
91
                </w:fldSimple>
92
            </xsl:when>
93
        </xsl:choose>
94
    </xsl:template>
95
    
96
    
97
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
98
      <desc>
99
        Dealing with divGens
100
    </desc>
101
   </doc>
102
    <xsl:template match="tei:divGen">
103
        <xsl:choose>
104
            <xsl:when test="@type='toc'">
105
                <xsl:call-template name="generate-toc"/>
106
            </xsl:when>
107
        </xsl:choose>
108
        
109
    </xsl:template>
110
    
111
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
112
      <desc>
113
        Table of Contents:
114
        Feel free to overwrite this one.
115
    </desc>
116
   </doc>
117
    <xsl:template name="generate-toc">
118
        <w:p>
119
            <w:pPr>
120
                <w:pStyle w:val="TOC1"/>
121
                <w:tabs>
122
                    <w:tab w:val="right" w:leader="dot" w:pos="9350"/>
123
                </w:tabs>
124
            </w:pPr>
125
            <w:r>
126
                <w:fldChar w:fldCharType="begin"/>
127
            </w:r>
128
            <w:r>
129
                <w:rPr>
130
                    <w:noProof/>
131
                </w:rPr>
132
                <w:instrText xml:space="preserve"> TOC \o "1-6" \h \z </w:instrText>
133
            </w:r>
134
            <w:r>
135
                <w:fldChar w:fldCharType="separate"/>
136
            </w:r>
137
            <w:r>
138
                <w:fldChar w:fldCharType="end"/>
139
            </w:r>
140
        </w:p>
141
    </xsl:template>
142
    
143
</xsl:stylesheet>