Statistics
| Revision:

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

History | View | Annotate | Download (5.4 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
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
35
      <desc>
36
         <p> TEI stylesheet for making Word docx files from TEI XML </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: comments.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
71
         <p>Copyright: 2008, TEI Consortium</p>
72
      </desc>
73
   </doc>
74
    
75
    <xsl:key name="COMMENTS" match="tei:note[@place='comment']"    use="1"/>
76

    
77
    <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
78
      <desc>
79
        Create the comments file
80
    </desc>
81
   </doc>
82
    <!-- write out comments -->
83
    <xsl:template name="write-docxfile-comments-file">
84

    
85
      <xsl:if test="count(key('COMMENTS',1))&gt;0">
86
	<xsl:if test="$debug='true'">
87
	  <xsl:message>Writing out <xsl:value-of select="concat($wordDirectory,'word/comments.xml')"/>
88
	  </xsl:message>
89
	</xsl:if>
90
	<xsl:result-document href="{concat($wordDirectory,'/word/comments.xml')}" standalone="yes">
91
	  <w:comments>
92
	    <xsl:for-each select="key('COMMENTS',1)">
93
	      <w:comment w:id="{position()-1}" w:author="{@resp}">
94
		<xsl:attribute name="w:date">
95
		  <xsl:choose>
96
		  <xsl:when test="tei:date/@when">
97
		    <xsl:value-of select="tei:date/@when"/>
98
		  </xsl:when>
99
		  <xsl:otherwise>
100
		    <xsl:value-of select="tei:whatsTheDate()"/>
101
		  </xsl:otherwise>
102
		  </xsl:choose>
103
		</xsl:attribute>
104
		<w:p>
105
		  <w:pPr>
106
		  <w:pStyle w:val="CommentText"/></w:pPr>
107
		  <w:r>
108
		    <w:rPr>
109
		      <w:rStyle w:val="CommentReference"/>
110
		    </w:rPr>
111
		    <w:annotationRef/>
112
		  </w:r>
113
		  <xsl:apply-templates/>
114
		</w:p>
115
	      </w:comment>
116
	    </xsl:for-each>
117
	  </w:comments>
118
	</xsl:result-document>
119
      </xsl:if>
120
    </xsl:template>
121
</xsl:stylesheet>