Statistics
| Revision:

root / tmp / org.txm.core / res / org / txm / xml / xsl / tei / xhtml2 / drama.xsl @ 187

History | View | Annotate | Download (8.9 kB)

1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" 
3
                xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
4
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
5
                xmlns:html="http://www.w3.org/1999/xhtml"
6
                xmlns:rng="http://relaxng.org/ns/structure/1.0"
7
                xmlns:tei="http://www.tei-c.org/ns/1.0"
8
                xmlns:teix="http://www.tei-c.org/ns/Examples"                
9
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10
                exclude-result-prefixes=" a fo rng tei teix html"
11
                version="2.0">
12
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl" scope="stylesheet" type="stylesheet">
13
      <desc>
14
         <p> TEI stylesheet dealing with elements from the drama module,
15
      making HTML output. </p>
16
         <p>This software is dual-licensed:
17

    
18
1. Distributed under a Creative Commons Attribution-ShareAlike 3.0
19
Unported License http://creativecommons.org/licenses/by-sa/3.0/ 
20

    
21
2. http://www.opensource.org/licenses/BSD-2-Clause
22
		
23
All rights reserved.
24

    
25
Redistribution and use in source and binary forms, with or without
26
modification, are permitted provided that the following conditions are
27
met:
28

    
29
* Redistributions of source code must retain the above copyright
30
notice, this list of conditions and the following disclaimer.
31

    
32
* Redistributions in binary form must reproduce the above copyright
33
notice, this list of conditions and the following disclaimer in the
34
documentation and/or other materials provided with the distribution.
35

    
36
This software is provided by the copyright holders and contributors
37
"as is" and any express or implied warranties, including, but not
38
limited to, the implied warranties of merchantability and fitness for
39
a particular purpose are disclaimed. In no event shall the copyright
40
holder or contributors be liable for any direct, indirect, incidental,
41
special, exemplary, or consequential damages (including, but not
42
limited to, procurement of substitute goods or services; loss of use,
43
data, or profits; or business interruption) however caused and on any
44
theory of liability, whether in contract, strict liability, or tort
45
(including negligence or otherwise) arising in any way out of the use
46
of this software, even if advised of the possibility of such damage.
47
</p>
48
         <p>Author: See AUTHORS</p>
49
         <p>Id: $Id: drama.xsl 9646 2011-11-05 23:39:08Z rahtz $</p>
50
         <p>Copyright: 2011, TEI Consortium</p>
51
      </desc>
52
   </doc>
53
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
54
      <desc>Process element actor</desc>
55
   </doc>
56
  <xsl:template match="tei:actor">
57
      <span class="actor">
58
         <xsl:apply-templates/>
59
      </span>
60
  </xsl:template>
61
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
62
      <desc>Process element camera</desc>
63
   </doc>
64
  <xsl:template match="tei:camera">
65
      <span class="camera">
66
         <xsl:apply-templates/>
67
      </span>
68
  </xsl:template>
69
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
70
      <desc>Process element caption</desc>
71
   </doc>
72
  <xsl:template match="tei:caption">
73
      <span class="caption">
74
         <xsl:apply-templates/>
75
      </span>
76
  </xsl:template>
77
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
78
      <desc>Process element castGroup</desc>
79
   </doc>
80
  <xsl:template match="tei:castGroup">
81
      <ul>
82
         <xsl:apply-templates/>
83
      </ul>
84
  </xsl:template>
85
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
86
      <desc>Process element castItem</desc>
87
   </doc>
88
  <xsl:template match="tei:castItem">
89
      <li>
90
         <xsl:apply-templates/>
91
      </li>
92
  </xsl:template>
93
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
94
      <desc>Process element castList</desc>
95
   </doc>
96
  <xsl:template match="tei:castList">
97
      <xsl:if test="tei:head">
98
         <p>
99
            <em>
100
               <xsl:for-each select="tei:head">
101
                  <xsl:apply-templates/>
102
               </xsl:for-each>
103
            </em>
104
         </p>
105
      </xsl:if>
106
      <ul>
107
         <xsl:apply-templates/>
108
      </ul>
109
  </xsl:template>
110
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
111
      <desc>Process element castList/tei:head</desc>
112
   </doc>
113
  <xsl:template match="tei:castList/tei:head"/>
114
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
115
      <desc>Process element role</desc>
116
   </doc>
117
  <xsl:template match="tei:role">
118
      <span class="role">
119
         <xsl:apply-templates/>
120
      </span>
121
  </xsl:template>
122

    
123
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
124
      <desc>Process element roleDesc</desc>
125
   </doc>
126
  <xsl:template match="tei:roleDesc">
127
      <blockquote>
128
	        <xsl:choose>
129
	           <xsl:when test="@rend">
130
	              <xsl:attribute name="class">
131
		                <xsl:value-of select="@rend"/>
132
	              </xsl:attribute>
133
	           </xsl:when>
134
	           <xsl:when test="@rendition">
135
		             <xsl:call-template name="applyRendition"/>
136
	           </xsl:when>
137
	           <xsl:otherwise>
138
	              <xsl:attribute name="class">
139
		                <xsl:text>roleDesc</xsl:text>
140
	              </xsl:attribute>
141
	           </xsl:otherwise>
142
	        </xsl:choose>
143
         <xsl:choose>
144
            <xsl:when test="tei:p">
145
               <xsl:apply-templates/>
146
            </xsl:when>
147
            <xsl:otherwise>
148
               <p>
149
                  <xsl:apply-templates/>
150
               </p>
151
            </xsl:otherwise>
152
         </xsl:choose>
153
      </blockquote>
154
  </xsl:template>
155
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
156
      <desc>Process element set</desc>
157
   </doc>
158
  <xsl:template match="tei:set">
159
      <span class="set">
160
         <xsl:apply-templates/>
161
      </span>
162
  </xsl:template>
163
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
164
      <desc>Process element sound</desc>
165
   </doc>
166
  <xsl:template match="tei:sound">
167
      <span class="sound">
168
         <xsl:apply-templates/>
169
      </span>
170
  </xsl:template>
171
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
172
      <desc>
173
         <p>Process element sp</p>
174
         <p>
175
            <p xmlns="http://www.w3.org/1999/xhtml"> elaborated by Nick Nicholas &lt;nicholas@uci.edu&gt;, March
176
        2001 </p>
177
         </p>
178
      </desc>
179
   </doc>
180
  <xsl:template match="tei:sp">
181
    <div class="speaker">
182
      <xsl:call-template name="makeAnchor"/>
183
      <xsl:apply-templates select="tei:speaker"/>
184
    </div>
185
    <xsl:apply-templates select="tei:*[not(self::tei:speaker)]"/>
186
  </xsl:template>
187
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
188
      <desc>Process element sp/tei:p</desc>
189
   </doc>
190
  <xsl:template match="tei:sp/tei:p">
191
    <xsl:choose>
192
      <xsl:when test="$filePerPage='true'">
193
	<xsl:for-each-group select="node()" group-starting-with="tei:pb">
194
	  <xsl:choose>
195
	    <xsl:when test="self::tei:pb">
196
	      <xsl:apply-templates select="."/>
197
	      <div>
198
		<xsl:for-each select="..">
199
		  <xsl:call-template name="rendToClass">      
200
		    <xsl:with-param name="default">p-in-sp</xsl:with-param>
201
		    <xsl:with-param name="id">
202
		      <xsl:choose>
203
			<xsl:when test="@xml:id">
204
			  <xsl:value-of select="@xml:id"/>
205
			  <xsl:text>continued</xsl:text>
206
			</xsl:when>
207
			<xsl:otherwise>
208
			  <xsl:text>false</xsl:text>
209
			</xsl:otherwise>
210
		      </xsl:choose>
211
		    </xsl:with-param>
212
		  </xsl:call-template>
213
		</xsl:for-each>
214
		<xsl:apply-templates select="current-group() except ."/>
215
	      </div>
216
	    </xsl:when>
217
	    <xsl:otherwise>
218
	      <div>
219
		<xsl:for-each select="..">
220
		  <xsl:call-template name="rendToClass">      
221
		    <xsl:with-param name="default">p-in-sp</xsl:with-param>
222
		  </xsl:call-template>
223
		</xsl:for-each>
224
		<xsl:apply-templates select="current-group()"/>
225
	      </div>
226
	    </xsl:otherwise>
227
	  </xsl:choose>
228
	</xsl:for-each-group>
229
      </xsl:when>
230
      <xsl:otherwise>
231
	<div>
232
	  <xsl:call-template name="rendToClass">      
233
	    <xsl:with-param name="default">p-in-sp</xsl:with-param>
234
	  </xsl:call-template>
235
	  <xsl:apply-templates/>
236
	</div>
237
      </xsl:otherwise>
238
    </xsl:choose>
239
  </xsl:template>
240

    
241
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
242
      <desc>Process element stage</desc>
243
   </doc>
244
  <xsl:template match="tei:stage">
245
    <xsl:element name="{if (tei:blockContext(.) or *[not(tei:is-inline(.))]) then 'div' else 'span' }">
246
      <xsl:call-template name="rendToClass">
247
	<xsl:with-param name="default">
248
	  <xsl:choose>
249
	    <xsl:when
250
		test="ancestor::tei:text/@rend='firstfolio'">stage</xsl:when>
251
	    <xsl:otherwise>stage it</xsl:otherwise>
252
	  </xsl:choose>
253
	</xsl:with-param>
254
      </xsl:call-template>
255
      <xsl:apply-templates/>
256
    </xsl:element>
257
  </xsl:template>
258

    
259
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
260
      <desc>Process element tech</desc>
261
   </doc>
262
  <xsl:template match="tei:tech">
263
      <span class="tech">
264
         <xsl:apply-templates/>
265
      </span>
266
  </xsl:template>
267
  <doc xmlns="http://www.oxygenxml.com/ns/doc/xsl">
268
      <desc>Process element view</desc>
269
   </doc>
270
  <xsl:template match="tei:view">
271
      <span class="view">
272
         <xsl:apply-templates/>
273
      </span>
274
  </xsl:template>
275
</xsl:stylesheet>