Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / docx / to / docxfiles / content-types.xsl @ 187

History | View | Annotate | Download (9.8 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: content-types.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
72
         <p>Copyright: 2008, TEI Consortium</p>
73
      </desc>
74
   </doc>
75
    
76
    <xsl:template name="write-docxfile-content-types">
77
	     <xsl:if test="$debug='true'">
78
	        <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'/%5BContent_Types%5D.xml')"/>
79
         </xsl:message>
80
	     </xsl:if>
81

    
82
        <xsl:result-document href="{concat($wordDirectory,'/%5BContent_Types%5D.xml')}">
83
            
84
            <Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
85
                
86
                <Default Extension="jpeg" ContentType="image/jpeg"/>
87
                <Default Extension="jpg" ContentType="image/jpeg"/>
88
                <Default Extension="png" ContentType="image/png"/>
89
                <Default Extension="tiff" ContentType="image/tiff"/>
90
                <Default Extension="rels"
91
                     ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
92
                <Default Extension="xml" ContentType="application/xml"/>
93
                <Default Extension="bin"
94
                     ContentType="application/vnd.openxmlformats-officedocument.oleObject"/>
95
                <Default Extension="wmf" ContentType="image/x-wmf"/>
96
                <Default Extension="emf" ContentType="image/x-emf"/>
97
                
98
                
99
                <!-- docprops -->
100
                <Override PartName="/docProps/core.xml"
101
                      ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
102
                <Override PartName="/docProps/app.xml"
103
                      ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
104
                <Override PartName="/docProps/custom.xml"
105
                      ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/>
106
                
107
                <!-- word -->
108
                <Override PartName="/word/document.xml"
109
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
110
                <Override PartName="/word/styles.xml"
111
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
112
                <Override PartName="/word/numbering.xml"
113
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/>
114
                <Override PartName="/word/webSettings.xml"
115
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/>
116
                
117
                <Override PartName="/word/endnotes.xml"
118
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"/>
119
                <Override PartName="/word/fontTable.xml"
120
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/>
121
                <Override PartName="/word/footnotes.xml"
122
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"/>
123
                <Override PartName="/word/settings.xml"
124
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/>
125
		<Override PartName="/word/comments.xml"
126
                      ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"/>
127

    
128
                <!-- others -->
129
                <Override PartName="/word/theme/theme1.xml"
130
                      ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>
131
                
132
                <!-- headers -->
133
                <xsl:choose>
134
                    <xsl:when test="count(key('ALLHEADERS',1))=0">
135
                        <xsl:for-each select="document($defaultHeaderFooterFile)">
136
                            <xsl:call-template name="write-docxfile-content-types-header-references"/>
137
                        </xsl:for-each>
138
                    </xsl:when>
139
                    <xsl:otherwise>
140
                        <xsl:call-template name="write-docxfile-content-types-header-references"/>
141
                    </xsl:otherwise>
142
                </xsl:choose>
143
                
144
                
145
                <!-- footers -->
146
                <xsl:choose>
147
                    <xsl:when test="count(key('ALLFOOTERS',1))=0">
148
                        <xsl:for-each select="document($defaultHeaderFooterFile)">
149
                            <xsl:call-template name="write-docxfile-content-types-footer-references"/>
150
                        </xsl:for-each>
151
                    </xsl:when>
152
                    <xsl:otherwise>
153
                        <xsl:call-template name="write-docxfile-content-types-footer-references"/>
154
                    </xsl:otherwise>
155
                </xsl:choose>
156
            </Types>
157
            
158
        </xsl:result-document>
159
    </xsl:template>
160
    
161
    
162
    
163
    <xsl:template name="write-docxfile-content-types-footer-references">
164
        <xsl:for-each select="key('ALLFOOTERS',1)">
165
            <Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types"
166
                   ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml">
167
                <xsl:attribute name="PartName" select="concat('/word/footer', position(), '.xml')"/>
168
            </Override>            
169
        </xsl:for-each>
170
    </xsl:template>
171
    
172
    <xsl:template name="write-docxfile-content-types-header-references">
173
        <xsl:for-each select="key('ALLHEADERS',1)">
174
            <Override xmlns="http://schemas.openxmlformats.org/package/2006/content-types"
175
                   ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml">
176
                <xsl:attribute name="PartName" select="concat('/word/header', position(), '.xml')"/>
177
            </Override>
178
        </xsl:for-each>
179
    </xsl:template>
180
    
181
    
182
    
183
</xsl:stylesheet>