Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / docx / from / utils / utility-templates.xsl @ 187

History | View | Annotate | Download (5.9 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet 
3
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
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
                
30
                xmlns="http://www.tei-c.org/ns/1.0"
31
                version="2.0"
32
                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 ">
33

    
34

    
35
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
36
      <desc>
37
         <p> TEI stylesheet for converting Word docx files to TEI </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: utility-templates.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="generateAppInfo">
77
      <appInfo>
78
	        <application ident="TEI_fromDOCX" version="2.15.0">
79
	           <label>DOCX to TEI</label>
80
	        </application>
81
	        <xsl:if test="doc-available(concat($wordDirectory,'/docProps/custom.xml'))">
82
	           <xsl:for-each select="document(concat($wordDirectory,'/docProps/custom.xml'))/prop:Properties">
83
	              <xsl:for-each select="prop:property">
84
	                 <xsl:choose>
85
		                   <xsl:when test="@name='TEI_fromDOCX'"/>
86
		                   <xsl:when test="contains(@name,'TEI')">
87
		                      <application ident="{@name}" version="{.}">
88
		                         <label>
89
		                            <xsl:value-of select="@name"/>
90
		                         </label>
91
		                      </application>
92
		                   </xsl:when>
93
	                 </xsl:choose>
94
	              </xsl:for-each>
95
		      <xsl:if test="prop:property[@name='WordTemplateURI']">
96
			<application ident="WordTemplate" version="{prop:property[@name='WordTemplate']}">
97
			  <label>Word template file</label>
98
			  <ptr target="{prop:property[@name='WordTemplateURI']}"/>
99
			</application>
100
		      </xsl:if>
101
	           </xsl:for-each>
102
	        </xsl:if>
103
      </appInfo>
104
    </xsl:template>
105

    
106
    <xsl:template name="getDocTitle">
107
      <xsl:value-of select="$docProps/cp:coreProperties/dc:title"/>
108
    </xsl:template>
109

    
110
    <xsl:template name="getDocAuthor">
111
      <xsl:value-of select="$docProps/cp:coreProperties/dc:creator"/>
112
    </xsl:template>
113

    
114
    <xsl:template name="getDocDate">
115
      <xsl:value-of select="substring-before($docProps/cp:coreProperties/dcterms:created,'T')"/>
116
    </xsl:template>
117

    
118
    <xsl:template name="identifyChange">
119
      <xsl:param name="who"/>
120
      <xsl:attribute name="resp">
121
	<xsl:text>#</xsl:text>
122
	<xsl:value-of select="translate($who,' ','_')"/>
123
      </xsl:attribute>
124
    </xsl:template>
125

    
126

    
127
</xsl:stylesheet>