Statistics
| Revision:

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

History | View | Annotate | Download (5.9 kB)

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

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

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

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

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

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

    
56
This software is provided by the copyright holders and contributors
57
"as is" and any express or implied warranties, including, but not
58
limited to, the implied warranties of merchantability and fitness for
59
a particular purpose are disclaimed. In no event shall the copyright
60
holder or contributors be liable for any direct, indirect, incidental,
61
special, exemplary, or consequential damages (including, but not
62
limited to, procurement of substitute goods or services; loss of use,
63
data, or profits; or business interruption) however caused and on any
64
theory of liability, whether in contract, strict liability, or tort
65
(including negligence or otherwise) arising in any way out of the use
66
of this software, even if advised of the possibility of such damage.
67
</p>
68
         <p>Author: See AUTHORS</p>
69
         <p>Id: $Id: wordsections.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
70
         <p>Copyright: 2008, TEI Consortium</p>
71
      </desc>
72
   </doc>
73
    
74
    
75
    
76
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
77
      <desc>
78
         <p>match strange word sections</p>
79
         <p>
80
            See comment at begin of document to understand why this template is calling
81
            a named template. It matches strange Word "sections".
82
        </p>
83
      </desc>
84
   </doc>
85
    <xsl:template match="w:p[w:pPr/w:sectPr]|w:sectPr" mode="paragraph">
86
        <xsl:call-template name="paragraph-sectpr"/>
87
    </xsl:template>
88
    
89
    
90
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
91
      <desc>
92
        Template called by a match on w:p[w:pPr/w:sectPr]|w:sectPr
93
    </desc>
94
   </doc>
95
    <xsl:template name="paragraph-sectpr">
96
      <xsl:if test="$preserveWordSections='true'">
97
        <xsl:for-each select="descendant-or-self::w:sectPr">
98
            <milestone unit="section">
99
                <xsl:for-each select="w:headerReference">
100
                    <tei:header type="{@w:type}" ref="{@r:id}"/>
101
                </xsl:for-each>
102
                <xsl:for-each select="w:footerReference">
103
                    <tei:footer type="{@w:type}" ref="{@r:id}"/>
104
                </xsl:for-each>
105
                <xsl:if test="w:pgSz/@w:orient='landscape'">
106
                    <tei:orientation type="landscape"/>
107
                </xsl:if>
108
                <xsl:if test="w:pgNumType">
109
                    <tei:pageNumbering>
110
                        <xsl:if test="w:pgNumType/@w:start">
111
                            <xsl:attribute name="start" select="w:pgNumType/@w:start"/>
112
                        </xsl:if>
113
                        <xsl:if test="w:pgNumType/@w:fmt">
114
                            <xsl:attribute name="type" select="w:pgNumType/@w:fmt"/>
115
                        </xsl:if>
116
                    </tei:pageNumbering>
117
                </xsl:if>
118
            </milestone>
119
        </xsl:for-each>
120
      </xsl:if>
121
      <xsl:next-match/>
122
    </xsl:template>
123
    
124
    
125
</xsl:stylesheet>