1 |
1 |
<?xml version="1.0"?>
|
2 |
|
<xsl:stylesheet
|
3 |
|
xmlns:edate="http://exslt.org/dates-and-times"
|
4 |
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
5 |
|
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
|
2 |
<xsl:stylesheet xmlns:edate="http://exslt.org/dates-and-times"
|
|
3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
4 |
xmlns:tei="http://www.tei-c.org/ns/1.0"
|
6 |
5 |
xmlns:txm="http://textometrie.org/1.0"
|
7 |
6 |
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
8 |
7 |
xmlns:xd="http://www.pnp-software.com/XSLTdoc"
|
9 |
|
exclude-result-prefixes="#all" version="2.0">
|
10 |
|
|
|
8 |
exclude-result-prefixes="#all" version="2.0">
|
|
9 |
|
11 |
10 |
<xd:doc type="stylesheet">
|
12 |
11 |
<xd:short>
|
13 |
|
This stylesheet is designed for TXM XTZ import module to
|
14 |
|
create
|
15 |
|
HTML editions of corpus texts. This stylesheet should be used at
|
16 |
|
"4-edition" step and must be accompanied by 2-default-pager.xsl.
|
17 |
|
See TXM User Manual for more details
|
|
12 |
This stylesheet is designed for TXM XTZ import module to create
|
|
13 |
HTML editions of corpus texts. This stylesheet should be used at
|
|
14 |
"4-edition" step and must be accompanied by 2-default-pager.xsl.
|
|
15 |
See TXM User Manual for more details
|
18 |
16 |
(http://textometrie.ens-lyon.fr/spip.php?rubrique64)
|
19 |
17 |
</xd:short>
|
20 |
18 |
<xd:detail>
|
21 |
|
This stylesheet is free software; you can redistribute it
|
22 |
|
and/or
|
|
19 |
This stylesheet is free software; you can redistribute it and/or
|
23 |
20 |
modify it under the terms of the GNU Lesser General Public
|
24 |
21 |
License as published by the Free Software Foundation; either
|
25 |
|
version 3
|
26 |
|
of the License, or (at your option) any later version.
|
27 |
|
|
|
22 |
version 3 of the License, or (at your option) any later version.
|
|
23 |
|
28 |
24 |
This stylesheet is distributed in the hope that it will be useful,
|
29 |
|
but
|
30 |
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
31 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
25 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
26 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
32 |
27 |
Lesser General Public License for more details.
|
33 |
|
|
|
28 |
|
34 |
29 |
You should have received a copy of GNU Lesser Public License with
|
35 |
|
this
|
36 |
|
stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
|
|
30 |
this stylesheet. If not, see http://www.gnu.org/licenses/lgpl.html
|
37 |
31 |
</xd:detail>
|
38 |
32 |
<xd:author>Alexei Lavrentiev alexei.lavrentev@ens-lyon.fr</xd:author>
|
39 |
33 |
<xd:copyright>2017, CNRS / UMR 5317 IHRIM (CACTUS research group)</xd:copyright>
|
40 |
34 |
</xd:doc>
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no"/>
|
|
39 |
|
|
40 |
<!-- <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> -->
|
|
41 |
|
|
42 |
|
|
43 |
<xsl:strip-space elements="*"/>
|
|
44 |
|
|
45 |
<xsl:param name="pagination-element">pb</xsl:param>
|
|
46 |
|
|
47 |
<xsl:variable name="word-element">w</xsl:variable>
|
|
48 |
|
|
49 |
<xsl:variable name="page-number-adjust" as="xs:integer">2</xsl:variable>
|
|
50 |
|
41 |
51 |
|
|
52 |
<!-- The conditional values below should be used with corpora tokenized at character level-->
|
42 |
53 |
|
43 |
|
|
44 |
|
<xsl:output method="xml" encoding="UTF-8"
|
45 |
|
omit-xml-declaration="no" indent="no" />
|
46 |
|
|
47 |
|
<!-- <xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no"
|
48 |
|
indent="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> -->
|
49 |
|
|
50 |
|
|
51 |
|
<xsl:strip-space elements="*" />
|
52 |
|
|
53 |
|
<xsl:param name="pagination-element">
|
54 |
|
pb
|
55 |
|
</xsl:param>
|
56 |
|
|
57 |
|
<xsl:variable name="word-element">
|
|
54 |
<!--<xsl:variable name="word-element">
|
58 |
55 |
<xsl:choose>
|
59 |
|
<xsl:when test="//tei:c//txm:form">
|
60 |
|
c
|
61 |
|
</xsl:when>
|
62 |
|
<xsl:otherwise>
|
63 |
|
w
|
64 |
|
</xsl:otherwise>
|
|
56 |
<xsl:when test="//tei:c//txm:form">c</xsl:when>
|
|
57 |
<xsl:otherwise>w</xsl:otherwise>
|
65 |
58 |
</xsl:choose>
|
66 |
59 |
</xsl:variable>
|
67 |
60 |
|
68 |
61 |
<xsl:variable name="page-number-adjust" as="xs:integer">
|
69 |
62 |
<xsl:choose>
|
70 |
|
<xsl:when test="//tei:c//txm:form">
|
71 |
|
1
|
72 |
|
</xsl:when>
|
73 |
|
<xsl:otherwise>
|
74 |
|
2
|
75 |
|
</xsl:otherwise>
|
|
63 |
<xsl:when test="//tei:c//txm:form">1</xsl:when>
|
|
64 |
<xsl:otherwise>2</xsl:otherwise>
|
76 |
65 |
</xsl:choose>
|
77 |
|
</xsl:variable>
|
|
66 |
</xsl:variable>-->
|
|
67 |
|
|
68 |
|
78 |
69 |
|
79 |
|
|
80 |
|
<xsl:variable name="inputtype">
|
81 |
|
<xsl:choose>
|
82 |
|
<xsl:when test="//tei:w//txm:form">
|
83 |
|
xmltxm
|
84 |
|
</xsl:when>
|
85 |
|
<xsl:otherwise>
|
86 |
|
xmlw
|
87 |
|
</xsl:otherwise>
|
88 |
|
</xsl:choose>
|
89 |
|
</xsl:variable>
|
90 |
|
|
|
70 |
<xsl:variable name="inputtype">
|
|
71 |
<xsl:choose>
|
|
72 |
<xsl:when test="//tei:w//txm:form">xmltxm</xsl:when>
|
|
73 |
<xsl:otherwise>xmlw</xsl:otherwise>
|
|
74 |
</xsl:choose>
|
|
75 |
</xsl:variable>
|
|
76 |
|
91 |
77 |
<xsl:variable name="filename">
|
92 |
|
<xsl:analyze-string select="document-uri(.)"
|
93 |
|
regex="^(.*)/([^/]+)\.[^/.]+$">
|
|
78 |
<xsl:analyze-string select="document-uri(.)" regex="^(.*)/([^/]+)\.[^/.]+$">
|
94 |
79 |
<xsl:matching-substring>
|
95 |
|
<xsl:value-of select="regex-group(2)" />
|
|
80 |
<xsl:value-of select="regex-group(2)"/>
|
96 |
81 |
</xsl:matching-substring>
|
97 |
82 |
</xsl:analyze-string>
|
98 |
83 |
</xsl:variable>
|
|
84 |
|
|
85 |
<!-- New template for the document node provided for Saxon 11 (1st pagination step moved here) -->
|
|
86 |
|
|
87 |
<!--<xsl:template match="/">
|
|
88 |
<html>
|
|
89 |
<head>
|
|
90 |
<title><xsl:choose>
|
|
91 |
<xsl:when test="//tei:text/@id"><xsl:value-of select="//tei:text[1]/@id"/></xsl:when>
|
|
92 |
<xsl:otherwise><xsl:value-of select="$filename"/></xsl:otherwise>
|
|
93 |
</xsl:choose></title>
|
|
94 |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
|
|
95 |
<link rel="stylesheet" media="all" type="text/css" href="css/txm.css" />
|
|
96 |
</head>
|
|
97 |
<xsl:apply-templates select="descendant::tei:text"/>
|
|
98 |
</html>
|
|
99 |
</xsl:template>-->
|
99 |
100 |
|
100 |
101 |
<xsl:template match="/">
|
101 |
|
<html>
|
102 |
|
<head>
|
103 |
|
<title>
|
104 |
|
<xsl:choose>
|
105 |
|
<xsl:when test="//tei:text/@id">
|
106 |
|
<xsl:value-of select="//tei:text[1]/@id" />
|
107 |
|
</xsl:when>
|
108 |
|
<xsl:otherwise>
|
109 |
|
<xsl:value-of select="$filename" />
|
110 |
|
</xsl:otherwise>
|
111 |
|
</xsl:choose>
|
112 |
|
</title>
|
113 |
|
<meta http-equiv="Content-Type"
|
114 |
|
content="text/html;charset=UTF-8" />
|
115 |
|
<link rel="stylesheet" media="all" type="text/css"
|
116 |
|
href="css/txm.css" />
|
117 |
|
</head>
|
118 |
|
<xsl:apply-templates
|
119 |
|
select="descendant::tei:text" />
|
120 |
|
</html>
|
|
102 |
<xsl:variable name="pages">
|
|
103 |
<xsl:apply-templates select="descendant::tei:text"/>
|
|
104 |
</xsl:variable>
|
|
105 |
<pages>
|
|
106 |
<xsl:for-each select="$pages">
|
|
107 |
<xsl:apply-templates mode="paginate"/>
|
|
108 |
</xsl:for-each>
|
|
109 |
</pages>
|
121 |
110 |
</xsl:template>
|
|
111 |
|
|
112 |
|
|
113 |
<!-- Templates for pagination -->
|
|
114 |
|
|
115 |
<!-- first (recursive) pass. look for <pb> elements and group on them -->
|
|
116 |
|
|
117 |
|
|
118 |
<xsl:template match="comment()|@*|processing-instruction()|text()" mode="paginate">
|
|
119 |
<xsl:copy-of select="."/>
|
|
120 |
</xsl:template>
|
|
121 |
|
|
122 |
<xsl:template match="*" mode="paginate">
|
|
123 |
<xsl:call-template name="checkpb">
|
|
124 |
<xsl:with-param name="eName" select="local-name()"/>
|
|
125 |
<xsl:with-param name="class" select="@class"/>
|
|
126 |
</xsl:call-template>
|
|
127 |
</xsl:template>
|
|
128 |
|
|
129 |
<xsl:template match="a[@class='txm-page']" mode="paginate">
|
|
130 |
|
|
131 |
<a>
|
|
132 |
<xsl:copy-of select="@*"/>
|
|
133 |
<!--<xsl:attribute name="next-word-id"><xsl:value-of select="$next-word-id"/></xsl:attribute>-->
|
|
134 |
</a>
|
|
135 |
</xsl:template>
|
|
136 |
|
|
137 |
<xsl:template name="checkpb">
|
|
138 |
<xsl:param name="eName"/>
|
|
139 |
<xsl:param name="class"/>
|
|
140 |
<xsl:choose>
|
|
141 |
<xsl:when test="not(.//a[@class='txm-page'])">
|
|
142 |
<xsl:copy-of select="."/>
|
|
143 |
</xsl:when>
|
|
144 |
<xsl:otherwise>
|
|
145 |
<xsl:variable name="pass">
|
|
146 |
<xsl:call-template name="groupbypb">
|
|
147 |
<xsl:with-param name="Name" select="$eName"/>
|
|
148 |
<xsl:with-param name="class" select="$class"/>
|
|
149 |
</xsl:call-template>
|
|
150 |
</xsl:variable>
|
|
151 |
<xsl:for-each select="$pass">
|
|
152 |
<xsl:apply-templates mode="#current"/>
|
|
153 |
</xsl:for-each>
|
|
154 |
</xsl:otherwise>
|
|
155 |
</xsl:choose>
|
|
156 |
</xsl:template>
|
|
157 |
|
|
158 |
<xsl:template name="groupbypb">
|
|
159 |
<xsl:param name="Name"/>
|
|
160 |
<xsl:param name="class"/>
|
|
161 |
<xsl:for-each-group select="node()" group-starting-with="a[@class='txm-page']">
|
|
162 |
<xsl:choose>
|
|
163 |
<xsl:when test="self::a[@class='txm-page']">
|
|
164 |
<xsl:copy-of select="."/>
|
|
165 |
<xsl:element name="{$Name}">
|
|
166 |
<xsl:attribute name="rend">CONTINUED</xsl:attribute>
|
|
167 |
<xsl:attribute name="class" select="$class"/>
|
|
168 |
<xsl:apply-templates select="current-group() except ." mode="#current"/>
|
|
169 |
</xsl:element>
|
|
170 |
</xsl:when>
|
|
171 |
<xsl:otherwise>
|
|
172 |
<xsl:element name="{$Name}">
|
|
173 |
<xsl:for-each select="..">
|
|
174 |
<xsl:copy-of select="@*"/>
|
|
175 |
<xsl:apply-templates select="current-group()" mode="#current"/>
|
|
176 |
</xsl:for-each>
|
|
177 |
</xsl:element>
|
|
178 |
</xsl:otherwise>
|
|
179 |
</xsl:choose>
|
|
180 |
</xsl:for-each-group>
|
|
181 |
</xsl:template>
|
|
182 |
|
|
183 |
<!-- second pass. in the default-pager.xsl:
|
|
184 |
group by <pb> (now all at top level) and generate separate files for each page -->
|
|
185 |
|
122 |
186 |
|
|
187 |
|
123 |
188 |
<xsl:template match="tei:text">
|
124 |
189 |
<body>
|
125 |
190 |
<xsl:if test="$word-element='w'">
|
126 |
|
<a class="txm-page" title="1" next-word-id="w_0" />
|
|
191 |
<a class="txm-page" title="1" next-word-id="w_0"/>
|
127 |
192 |
<div class="metadata-page">
|
128 |
|
<h1>
|
129 |
|
<xsl:value-of select="@id"></xsl:value-of>
|
130 |
|
</h1>
|
131 |
|
<br />
|
|
193 |
<h1><xsl:value-of select="@id"></xsl:value-of></h1>
|
|
194 |
<br/>
|
132 |
195 |
<table>
|
133 |
196 |
<xsl:for-each select="@*">
|
134 |
197 |
<tr>
|
135 |
|
<td>
|
136 |
|
<xsl:value-of select="name()" />
|
137 |
|
</td>
|
138 |
|
<td>
|
139 |
|
<xsl:value-of select="." />
|
140 |
|
</td>
|
|
198 |
<td><xsl:value-of select="name()"/></td>
|
|
199 |
<td><xsl:value-of select="."/></td>
|
141 |
200 |
</tr>
|
142 |
201 |
</xsl:for-each>
|
143 |
202 |
</table>
|
144 |
203 |
</div>
|
145 |
|
|
|
204 |
|
146 |
205 |
</xsl:if>
|
147 |
|
<xsl:apply-templates />
|
148 |
|
|
149 |
|
<xsl:variable name="page_id">
|
150 |
|
<xsl:value-of
|
151 |
|
select="count(descendant::*[local-name()=$pagination-element])" />
|
152 |
|
</xsl:variable>
|
153 |
|
|
154 |
|
<xsl:if
|
155 |
|
test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][count(preceding::*[local-name()=$pagination-element]) = $page_id]">
|
|
206 |
<xsl:apply-templates/>
|
|
207 |
|
|
208 |
<xsl:variable name="page_id"><xsl:value-of select="count(descendant::*[local-name()=$pagination-element])"/></xsl:variable>
|
|
209 |
|
|
210 |
<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][count(preceding::*[local-name()=$pagination-element]) = $page_id]">
|
156 |
211 |
<xsl:text>
</xsl:text>
|
157 |
|
<br />
|
158 |
|
<br />
|
159 |
|
<span
|
160 |
|
style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
|
161 |
|
<xsl:for-each
|
162 |
|
select="//tei:note[count(preceding::*[local-name()=$pagination-element]) = $page_id]">
|
163 |
|
<xsl:variable name="note_count">
|
164 |
|
<xsl:value-of
|
165 |
|
select="count(preceding::tei:note) + 1" />
|
166 |
|
</xsl:variable>
|
167 |
|
<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}"
|
168 |
|
name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>,
|
169 |
|
l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text>
|
170 |
|
<xsl:value-of select="."/></p> -->
|
171 |
|
<span class="note">
|
172 |
|
<span style="position:absolute;left:-30px">
|
173 |
|
<a href="#noteref_{$note_count}" name="note_{$note_count}">
|
174 |
|
<xsl:value-of select="$note_count" />
|
175 |
|
</a>
|
176 |
|
.
|
177 |
|
</span>
|
178 |
|
<xsl:apply-templates mode="#current" />
|
179 |
|
</span>
|
180 |
|
</xsl:for-each>
|
181 |
|
</span>
|
182 |
|
<xsl:text>
</xsl:text>
|
183 |
|
|
|
212 |
<br/>
|
|
213 |
<br/>
|
|
214 |
<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
|
|
215 |
<xsl:for-each select="//tei:note[count(preceding::*[local-name()=$pagination-element]) = $page_id]">
|
|
216 |
<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:variable>
|
|
217 |
<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
|
|
218 |
<span class="footnote">
|
|
219 |
<span class="footnotenumber"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
|
|
220 |
<xsl:apply-templates mode="#current"/>
|
|
221 |
</span>
|
|
222 |
</xsl:for-each></span><xsl:text>
</xsl:text>
|
|
223 |
|
184 |
224 |
</xsl:if>
|
185 |
|
|
186 |
|
|
|
225 |
|
|
226 |
|
187 |
227 |
</body>
|
188 |
228 |
</xsl:template>
|
189 |
|
|
190 |
|
|
191 |
|
<xsl:template match="*">
|
192 |
|
<xsl:choose>
|
193 |
|
<xsl:when test="descendant::tei:p|descendant::tei:ab">
|
194 |
|
<div>
|
195 |
|
<xsl:call-template name="addClass" />
|
196 |
|
<xsl:apply-templates />
|
197 |
|
</div>
|
198 |
|
<xsl:text>
</xsl:text>
|
199 |
|
</xsl:when>
|
200 |
|
<xsl:otherwise>
|
201 |
|
<span>
|
202 |
|
<xsl:call-template name="addClass" />
|
203 |
|
<xsl:if test="self::tei:add[@del]">
|
204 |
|
<xsl:attribute name="title"><xsl:value-of
|
205 |
|
select="@del" /></xsl:attribute>
|
206 |
|
</xsl:if>
|
207 |
|
<xsl:apply-templates />
|
208 |
|
</span>
|
209 |
|
<xsl:call-template name="spacing" />
|
210 |
|
</xsl:otherwise>
|
211 |
|
</xsl:choose>
|
212 |
|
</xsl:template>
|
213 |
|
|
214 |
|
<xsl:template
|
215 |
|
match="@*|processing-instruction()|comment()">
|
216 |
|
<!--<xsl:copy/> -->
|
217 |
|
</xsl:template>
|
218 |
|
|
219 |
|
<!-- <xsl:template match="comment()"> <xsl:copy/> </xsl:template> -->
|
220 |
|
<xsl:template match="text()">
|
221 |
|
<xsl:value-of select="normalize-space(.)" />
|
222 |
|
</xsl:template>
|
223 |
|
|
224 |
|
<xsl:template name="addClass">
|
225 |
|
<xsl:attribute name="class">
|
226 |
|
<xsl:value-of select="local-name(.)" />
|
227 |
|
<xsl:if test="@type"><xsl:value-of
|
228 |
|
select="concat('-',@type)" /></xsl:if>
|
229 |
|
<xsl:if test="@subtype"><xsl:value-of
|
230 |
|
select="concat('-',@subtype)" /></xsl:if>
|
231 |
|
<xsl:if test="@rend"><xsl:value-of
|
232 |
|
select="concat('-',@rend)" /></xsl:if>
|
233 |
|
</xsl:attribute>
|
234 |
|
</xsl:template>
|
235 |
|
|
236 |
|
<xsl:template match="tei:p|tei:ab|tei:lg">
|
237 |
|
<p>
|
238 |
|
<xsl:call-template name="addClass" />
|
239 |
|
<xsl:apply-templates />
|
240 |
|
</p>
|
241 |
|
<xsl:text>
</xsl:text>
|
242 |
|
</xsl:template>
|
243 |
|
|
|
229 |
|
|
230 |
|
|
231 |
<xsl:template match="*">
|
|
232 |
<xsl:choose>
|
|
233 |
<xsl:when test="descendant::tei:p|descendant::tei:ab">
|
|
234 |
<div>
|
|
235 |
<xsl:call-template name="addClass"/>
|
|
236 |
<xsl:apply-templates/></div>
|
|
237 |
<xsl:text>
</xsl:text>
|
|
238 |
</xsl:when>
|
|
239 |
<xsl:otherwise><span>
|
|
240 |
<xsl:call-template name="addClass"/>
|
|
241 |
<xsl:if test="self::tei:add[@del]">
|
|
242 |
<xsl:attribute name="title"><xsl:value-of select="@del"/></xsl:attribute>
|
|
243 |
</xsl:if>
|
|
244 |
<xsl:apply-templates/></span>
|
|
245 |
<xsl:call-template name="spacing"/>
|
|
246 |
</xsl:otherwise>
|
|
247 |
</xsl:choose>
|
|
248 |
</xsl:template>
|
|
249 |
|
|
250 |
<xsl:template match="@*|processing-instruction()|comment()">
|
|
251 |
<!--<xsl:copy/>-->
|
|
252 |
</xsl:template>
|
|
253 |
|
|
254 |
<!-- <xsl:template match="comment()">
|
|
255 |
<xsl:copy/>
|
|
256 |
</xsl:template>
|
|
257 |
-->
|
|
258 |
<xsl:template match="text()">
|
|
259 |
<xsl:value-of select="normalize-space(.)"/>
|
|
260 |
</xsl:template>
|
|
261 |
|
|
262 |
<xsl:template name="addClass">
|
|
263 |
<xsl:attribute name="class">
|
|
264 |
<xsl:value-of select="local-name(.)"/>
|
|
265 |
<xsl:if test="@type"><xsl:value-of select="concat('-',@type)"/></xsl:if>
|
|
266 |
<xsl:if test="@subtype"><xsl:value-of select="concat('-',@subtype)"/></xsl:if>
|
|
267 |
<xsl:if test="@rend"><xsl:value-of select="concat('-',@rend)"/></xsl:if>
|
|
268 |
</xsl:attribute>
|
|
269 |
</xsl:template>
|
|
270 |
|
|
271 |
<xsl:template match="tei:p|tei:ab|tei:lg">
|
|
272 |
<p>
|
|
273 |
<xsl:call-template name="addClass"/>
|
|
274 |
<xsl:apply-templates/>
|
|
275 |
</p>
|
|
276 |
<xsl:text>
</xsl:text>
|
|
277 |
</xsl:template>
|
|
278 |
|
244 |
279 |
<xsl:template match="tei:head">
|
245 |
280 |
<h2>
|
246 |
|
<xsl:call-template name="addClass" />
|
247 |
|
<xsl:apply-templates />
|
|
281 |
<xsl:call-template name="addClass"/>
|
|
282 |
<xsl:apply-templates/>
|
248 |
283 |
</h2>
|
249 |
284 |
</xsl:template>
|
250 |
|
|
|
285 |
|
251 |
286 |
<xsl:template match="tei:gap">
|
252 |
287 |
<span class="gap">
|
253 |
288 |
<xsl:if test="@quantity and @unit">
|
254 |
|
<xsl:attribute name="title"><xsl:value-of
|
255 |
|
select="concat(@quantity,' ',@unit)" /></xsl:attribute>
|
|
289 |
<xsl:attribute name="title"><xsl:value-of select="concat(@quantity,' ',@unit)"/></xsl:attribute>
|
256 |
290 |
</xsl:if>
|
257 |
291 |
<xsl:text>[...]</xsl:text>
|
258 |
292 |
</span>
|
259 |
|
<xsl:call-template name="spacing" />
|
|
293 |
<xsl:call-template name="spacing"/>
|
260 |
294 |
</xsl:template>
|
261 |
|
|
262 |
|
<xsl:template match="//tei:lb">
|
|
295 |
|
|
296 |
<xsl:template match="tei:lb">
|
263 |
297 |
<xsl:variable name="lbcount">
|
264 |
298 |
<xsl:choose>
|
265 |
|
<xsl:when test="ancestor::tei:ab">
|
266 |
|
<xsl:number from="tei:ab" level="any" />
|
267 |
|
</xsl:when>
|
268 |
|
<xsl:when test="ancestor::tei:p">
|
269 |
|
<xsl:number from="tei:p" level="any" />
|
270 |
|
</xsl:when>
|
271 |
|
<xsl:otherwise>
|
272 |
|
999
|
273 |
|
</xsl:otherwise>
|
|
299 |
<xsl:when test="ancestor::tei:ab"><xsl:number from="tei:ab" level="any"/></xsl:when>
|
|
300 |
<xsl:when test="ancestor::tei:p"><xsl:number from="tei:p" level="any"/></xsl:when>
|
|
301 |
<xsl:otherwise>999</xsl:otherwise>
|
274 |
302 |
</xsl:choose>
|
275 |
303 |
</xsl:variable>
|
276 |
|
<xsl:if test="@rend='hyphen(-)'">
|
277 |
|
<span class="hyphen">-</span>
|
278 |
|
</xsl:if>
|
279 |
|
<xsl:if test="@rend='hyphen(=)'">
|
280 |
|
<span class="hyphen">=</span>
|
281 |
|
</xsl:if>
|
282 |
|
<xsl:if
|
283 |
|
test="ancestor::tei:w and not(contains(@rend,'hyphen'))">
|
284 |
|
<span class="hyphen-added">-</span>
|
285 |
|
</xsl:if>
|
286 |
|
<xsl:if
|
287 |
|
test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]">
|
288 |
|
<br />
|
289 |
|
<xsl:text>
</xsl:text>
|
290 |
|
</xsl:if>
|
|
304 |
<xsl:if test="@rend='hyphen(-)'"><span class="hyphen">-</span></xsl:if>
|
|
305 |
<xsl:if test="@rend='hyphen(=)'"><span class="hyphen">=</span></xsl:if>
|
|
306 |
<xsl:if test="ancestor::tei:w and not(contains(@rend,'hyphen'))"><span class="hyphen-added">-</span></xsl:if>
|
|
307 |
<xsl:if test="not($lbcount=1) or preceding-sibling::node()[matches(.,'\S')]"><br/><xsl:text>
</xsl:text></xsl:if>
|
291 |
308 |
<xsl:if test="@n and not(@rend='prose')">
|
292 |
309 |
<xsl:choose>
|
293 |
310 |
<xsl:when test="matches(@n,'^[0-9]*[05]$')">
|
294 |
|
<!--<a title="{@n}" class="verseline" style="position:relative"> </a> -->
|
295 |
|
<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of
|
296 |
|
select="@n"/></span></span> -->
|
297 |
|
<span class="verselinenumber">
|
298 |
|
<xsl:value-of select="@n" />
|
299 |
|
</span>
|
300 |
|
|
|
311 |
<!--<a title="{@n}" class="verseline" style="position:relative"> </a>-->
|
|
312 |
<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span>-->
|
|
313 |
<span class="verselinenumber"><xsl:value-of select="@n"/></span>
|
|
314 |
|
301 |
315 |
</xsl:when>
|
302 |
316 |
<xsl:when test="matches(@n,'[^0-9]')">
|
303 |
|
<!--<a title="{@n}" class="verseline" style="position:relative"> </a> -->
|
304 |
|
<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of
|
305 |
|
select="@n"/></span></span> -->
|
306 |
|
<span class="verselinenumber">
|
307 |
|
<xsl:value-of select="@n" />
|
308 |
|
</span>
|
|
317 |
<!--<a title="{@n}" class="verseline" style="position:relative"> </a>-->
|
|
318 |
<!--<span class="verseline"><span class="verselinenumber"><xsl:value-of select="@n"/></span></span>-->
|
|
319 |
<span class="verselinenumber"><xsl:value-of select="@n"/></span>
|
309 |
320 |
</xsl:when>
|
310 |
321 |
<xsl:otherwise>
|
311 |
322 |
</xsl:otherwise>
|
312 |
323 |
</xsl:choose>
|
313 |
324 |
</xsl:if>
|
314 |
325 |
</xsl:template>
|
315 |
|
|
316 |
|
<!-- Page breaks -->
|
317 |
|
<xsl:template
|
318 |
|
match="//*[local-name()=$pagination-element]">
|
319 |
|
|
|
326 |
|
|
327 |
<!-- Page breaks -->
|
|
328 |
<xsl:template match="*[local-name()=$pagination-element]">
|
|
329 |
|
320 |
330 |
<xsl:variable name="next-word-position" as="xs:integer">
|
321 |
331 |
<xsl:choose>
|
322 |
332 |
<xsl:when test="following::*[local-name()=$word-element]">
|
323 |
|
<xsl:value-of
|
324 |
|
select="count(following::*[local-name()=$word-element][1]/preceding::*[local-name()=$word-element])" />
|
|
333 |
<xsl:value-of select="count(following::*[local-name()=$word-element][1]/preceding::*[local-name()=$word-element])"/>
|
325 |
334 |
</xsl:when>
|
326 |
|
<xsl:otherwise>
|
327 |
|
0
|
328 |
|
</xsl:otherwise>
|
|
335 |
<xsl:otherwise>0</xsl:otherwise>
|
329 |
336 |
</xsl:choose>
|
330 |
337 |
</xsl:variable>
|
331 |
338 |
<xsl:variable name="next-pb-position" as="xs:integer">
|
332 |
339 |
<xsl:choose>
|
333 |
|
<xsl:when
|
334 |
|
test="following::*[local-name()=$pagination-element]">
|
335 |
|
<xsl:value-of
|
336 |
|
select="count(following::*[local-name()=$pagination-element][1]/preceding::*[local-name()=$word-element])" />
|
|
340 |
<xsl:when test="following::*[local-name()=$pagination-element]">
|
|
341 |
<xsl:value-of select="count(following::*[local-name()=$pagination-element][1]/preceding::*[local-name()=$word-element])"/>
|
337 |
342 |
</xsl:when>
|
338 |
|
<xsl:otherwise>
|
339 |
|
999999999
|
340 |
|
</xsl:otherwise>
|
|
343 |
<xsl:otherwise>999999999</xsl:otherwise>
|
341 |
344 |
</xsl:choose>
|
342 |
345 |
</xsl:variable>
|
343 |
346 |
<xsl:variable name="next-word-id">
|
344 |
347 |
<xsl:choose>
|
345 |
|
<xsl:when
|
346 |
|
test="$next-pb-position - $next-word-position = 999999999">
|
347 |
|
w_0
|
348 |
|
</xsl:when>
|
349 |
|
<xsl:when test="$next-pb-position > $next-word-position">
|
350 |
|
<xsl:value-of
|
351 |
|
select="following::*[local-name()=$word-element][1]/@id" />
|
352 |
|
</xsl:when>
|
353 |
|
<xsl:otherwise>
|
354 |
|
w_0
|
355 |
|
</xsl:otherwise>
|
|
348 |
<xsl:when test="$next-pb-position - $next-word-position = 999999999">w_0</xsl:when>
|
|
349 |
<xsl:when test="$next-pb-position > $next-word-position"><xsl:value-of select="following::*[local-name()=$word-element][1]/@id"/></xsl:when>
|
|
350 |
<xsl:otherwise>w_0</xsl:otherwise>
|
356 |
351 |
</xsl:choose>
|
357 |
352 |
</xsl:variable>
|
358 |
|
|
359 |
|
|
|
353 |
|
|
354 |
|
360 |
355 |
<xsl:variable name="editionpagetype">
|
361 |
356 |
<xsl:choose>
|
362 |
|
<xsl:when test="ancestor::tei:ab">
|
363 |
|
editionpageverse
|
364 |
|
</xsl:when>
|
365 |
|
<xsl:otherwise>
|
366 |
|
editionpage
|
367 |
|
</xsl:otherwise>
|
|
357 |
<xsl:when test="ancestor::tei:ab">editionpageverse</xsl:when>
|
|
358 |
<xsl:otherwise>editionpage</xsl:otherwise>
|
368 |
359 |
</xsl:choose>
|
369 |
360 |
</xsl:variable>
|
370 |
361 |
<xsl:variable name="pagenumber">
|
371 |
362 |
<xsl:choose>
|
372 |
|
<xsl:when test="@n">
|
373 |
|
<xsl:value-of select="@n" />
|
374 |
|
</xsl:when>
|
375 |
|
<xsl:when test="@facs">
|
376 |
|
<xsl:value-of select="substring-before(@facs,'.')" />
|
377 |
|
</xsl:when>
|
378 |
|
<xsl:otherwise>
|
379 |
|
[NN]
|
380 |
|
</xsl:otherwise>
|
|
363 |
<xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when>
|
|
364 |
<xsl:when test="@facs"><xsl:value-of select="substring-before(@facs,'.')"/></xsl:when>
|
|
365 |
<xsl:otherwise>[NN]</xsl:otherwise>
|
381 |
366 |
</xsl:choose>
|
382 |
367 |
</xsl:variable>
|
383 |
|
|
384 |
|
<xsl:variable name="page_id">
|
385 |
|
<xsl:value-of
|
386 |
|
select="count(preceding::*[local-name()=$pagination-element])" />
|
387 |
|
</xsl:variable>
|
388 |
|
|
389 |
|
<xsl:if
|
390 |
|
test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
|
|
368 |
|
|
369 |
<xsl:variable name="page_id"><xsl:value-of select="count(preceding::*[local-name()=$pagination-element])"/></xsl:variable>
|
|
370 |
|
|
371 |
<xsl:if test="//tei:note[not(@place='inline') and not(matches(@type,'intern|auto'))][following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
|
391 |
372 |
<xsl:text>
</xsl:text>
|
392 |
|
<br />
|
393 |
|
<br />
|
394 |
|
<span
|
395 |
|
style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
|
396 |
|
<xsl:for-each
|
397 |
|
select="//tei:note[following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
|
398 |
|
<xsl:variable name="note_count">
|
399 |
|
<xsl:value-of select="count(preceding::tei:note) + 1" />
|
400 |
|
</xsl:variable>
|
401 |
|
<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}"
|
402 |
|
name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>,
|
403 |
|
l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text>
|
404 |
|
<xsl:value-of select="."/></p> -->
|
405 |
|
<span class="note">
|
406 |
|
<span style="position:absolute;left:-30px">
|
407 |
|
<a href="#noteref_{$note_count}" name="note_{$note_count}">
|
408 |
|
<xsl:value-of select="$note_count" />
|
409 |
|
</a>
|
410 |
|
.
|
411 |
|
</span>
|
412 |
|
<xsl:apply-templates mode="#current" />
|
413 |
|
</span>
|
414 |
|
</xsl:for-each>
|
415 |
|
</span>
|
416 |
|
<xsl:text>
</xsl:text>
|
417 |
|
|
|
373 |
<br/>
|
|
374 |
<br/>
|
|
375 |
<span style="display:block;border-top-style:solid;border-top-width:1px;border-top-color:gray;padding-top:5px">
|
|
376 |
<xsl:for-each select="//tei:note[following::*[local-name()=$pagination-element][1][count(preceding::*[local-name()=$pagination-element]) = $page_id]]">
|
|
377 |
<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:variable>
|
|
378 |
<!--<p><xsl:value-of select="$note_count"/>. <a href="#noteref_{$note_count}" name="note_{$note_count}">[<xsl:value-of select="preceding::tei:cb[1]/@xml:id"/>, l. <xsl:value-of select="preceding::tei:lb[1]/@n"/>]</a><xsl:text> </xsl:text> <xsl:value-of select="."/></p>-->
|
|
379 |
<span class="footnote">
|
|
380 |
<span class="footnotenumber"><a href="#noteref_{$note_count}" name="note_{$note_count}"><xsl:value-of select="$note_count"/></a>. </span>
|
|
381 |
<xsl:apply-templates mode="#current"/>
|
|
382 |
<xsl:text> </xsl:text>
|
|
383 |
</span>
|
|
384 |
</xsl:for-each></span><xsl:text>
</xsl:text>
|
|
385 |
|
418 |
386 |
</xsl:if>
|
419 |
|
|
420 |
|
|
|
387 |
|
|
388 |
|
421 |
389 |
<xsl:text>
</xsl:text>
|
422 |
|
<br />
|
423 |
|
<xsl:text>
</xsl:text>
|
424 |
|
|
425 |
|
<a class="txm-page"
|
426 |
|
title="{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}"
|
427 |
|
next-word-id="{$next-word-id}" />
|
428 |
|
|
429 |
|
<span class="{$editionpagetype}">
|
430 |
|
<
|
431 |
|
<xsl:value-of select="$pagenumber" />
|
432 |
|
>
|
433 |
|
</span>
|
434 |
|
<br />
|
435 |
|
<xsl:text>
</xsl:text>
|
|
390 |
<br/><xsl:text>
</xsl:text>
|
|
391 |
|
|
392 |
<a class="txm-page" title="{count(preceding::*[local-name()=$pagination-element]) + $page-number-adjust}" next-word-id="{$next-word-id}"/>
|
|
393 |
|
|
394 |
<span class="{$editionpagetype}"> <<xsl:value-of select="$pagenumber"/>> </span><br/><xsl:text>
</xsl:text>
|
436 |
395 |
</xsl:template>
|
437 |
|
|
|
396 |
|
438 |
397 |
<!-- Notes -->
|
439 |
398 |
<xsl:template match="tei:note">
|
440 |
|
<!--<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>]
|
441 |
|
</span> -->
|
442 |
|
<xsl:variable name="note_count">
|
443 |
|
<xsl:value-of select="count(preceding::tei:note) + 1" />
|
444 |
|
</xsl:variable>
|
|
399 |
<!--<span style="color:violet"> [<b>Note :</b> <xsl:apply-templates/>] </span>-->
|
|
400 |
<xsl:variable name="note_count"><xsl:value-of select="count(preceding::tei:note) + 1"/></xsl:variable>
|
445 |
401 |
<xsl:variable name="note_content">
|
446 |
402 |
<xsl:choose>
|
447 |
403 |
<xsl:when test="descendant::txm:form">
|
448 |
|
<xsl:for-each select="descendant::txm:form">
|
449 |
|
<xsl:value-of select="." />
|
450 |
|
<xsl:if
|
451 |
|
test="not(matches(following::txm:form[1],'^[.,\)]')) and not(matches(.,'^\S+[''’]$|^[‘\(]$'))">
|
|
404 |
<xsl:for-each select="descendant::txm:form">
|
|
405 |
<xsl:value-of select="."/>
|
|
406 |
<xsl:if test="not(matches(following::txm:form[1],'^[.,\)]')) and not(matches(.,'^\S+[''’]$|^[‘\(]$'))">
|
452 |
407 |
<xsl:text> </xsl:text>
|
453 |
408 |
</xsl:if>
|
454 |
409 |
</xsl:for-each>
|
455 |
410 |
</xsl:when>
|
456 |
|
<xsl:otherwise>
|
457 |
|
<xsl:value-of select="normalize-space(.)" />
|
458 |
|
</xsl:otherwise>
|
|
411 |
<xsl:otherwise><xsl:value-of select="normalize-space(.)"/></xsl:otherwise>
|
459 |
412 |
</xsl:choose>
|
460 |
413 |
</xsl:variable>
|
461 |
414 |
<xsl:choose>
|
462 |
415 |
<xsl:when test="matches(@type,'intern|auto')"></xsl:when>
|
463 |
|
<xsl:when test="@place='inline'">
|
464 |
|
<span class="note">
|
465 |
|
(Note :
|
466 |
|
<xsl:value-of select="$note_content" />
|
467 |
|
)
|
468 |
|
</span>
|
|
416 |
<xsl:when test="@place='inline'"><span class="note"> (Note : <xsl:value-of select="$note_content"/>)</span></xsl:when>
|
|
417 |
<xsl:when test="not(@place='inline') and not(matches(@type,'intern|auto'))">
|
|
418 |
<a title="{$note_content}" style="font-size:75%;position:relative;top:-5px" href="#note_{$note_count}" name="noteref_{$note_count}">[<xsl:value-of select="$note_count"/>]</a>
|
469 |
419 |
</xsl:when>
|
470 |
|
<xsl:when
|
471 |
|
test="not(@place='inline') and not(matches(@type,'intern|auto'))">
|
472 |
|
<a title="{$note_content}"
|
473 |
|
style="font-size:75%;position:relative;top:-5px"
|
474 |
|
href="#note_{$note_count}" name="noteref_{$note_count}">
|
475 |
|
[
|
476 |
|
<xsl:value-of select="$note_count" />
|
477 |
|
]
|
478 |
|
</a>
|
479 |
|
</xsl:when>
|
480 |
|
<xsl:otherwise>
|
481 |
|
<span class="noteref" title="{$note_content}">[•]</span>
|
482 |
|
</xsl:otherwise>
|
|
420 |
<xsl:otherwise><span class="noteref" title="{$note_content}">[•]</span></xsl:otherwise>
|
483 |
421 |
</xsl:choose>
|
484 |
|
<xsl:call-template name="spacing" />
|
|
422 |
<xsl:call-template name="spacing"/>
|
485 |
423 |
</xsl:template>
|
486 |
|
|
|
424 |
|
487 |
425 |
<xsl:template match="tei:bibl">
|
488 |
426 |
<span class="noteref" title="{normalize-space(.)}">[•]</span>
|
489 |
427 |
</xsl:template>
|
490 |
|
|
|
428 |
|
491 |
429 |
<xsl:template match="a[@class='txmpageref']">
|
492 |
|
<xsl:copy-of select="." />
|
|
430 |
<xsl:copy-of select="."/>
|
493 |
431 |
</xsl:template>
|
494 |
|
|
495 |
|
<!--<xsl:template match="tei:note[@place='inline']"> <span class="noteinline">
|
496 |
|
<xsl:apply-templates/> </span> </xsl:template> -->
|
497 |
|
<xsl:template match="//tei:w">
|
498 |
|
<span class="w">
|
499 |
|
<xsl:choose>
|
500 |
|
<xsl:when test="descendant::tei:c//txm:form">
|
501 |
|
<xsl:apply-templates select="descendant::tei:c" />
|
502 |
|
</xsl:when>
|
503 |
|
<xsl:otherwise>
|
504 |
|
<xsl:if test="@*:id">
|
505 |
|
<xsl:attribute name="id"><xsl:value-of
|
506 |
|
select="@*:id" /></xsl:attribute>
|
507 |
|
</xsl:if>
|
508 |
|
<xsl:attribute name="title">
|
509 |
|
<xsl:for-each
|
510 |
|
select="@*[not(matches(local-name(.),'id'))]">
|
511 |
|
<xsl:value-of
|
512 |
|
select="concat(name(.),' : ',.,' ; ')" />
|
|
432 |
|
|
433 |
<!--<xsl:template match="tei:note[@place='inline']">
|
|
434 |
<span class="noteinline">
|
|
435 |
<xsl:apply-templates/>
|
|
436 |
</span>
|
|
437 |
</xsl:template>
|
|
438 |
-->
|
|
439 |
<xsl:template match="tei:w"><span class="w">
|
|
440 |
<xsl:choose>
|
|
441 |
<xsl:when test="descendant::tei:c//txm:form">
|
|
442 |
<xsl:apply-templates select="descendant::tei:c"/>
|
|
443 |
</xsl:when>
|
|
444 |
<xsl:otherwise>
|
|
445 |
<xsl:if test="@*:id">
|
|
446 |
<xsl:attribute name="id"><xsl:value-of select="@*:id"/></xsl:attribute>
|
|
447 |
</xsl:if>
|
|
448 |
<xsl:attribute name="title">
|
|
449 |
<xsl:for-each select="@*[not(matches(local-name(.),'id'))]">
|
|
450 |
<xsl:value-of select="concat(name(.),' : ',.,' ; ')"/>
|
513 |
451 |
</xsl:for-each>
|
514 |
452 |
<xsl:if test="descendant::txm:ana">
|
515 |
|
<xsl:for-each
|
516 |
|
select="descendant::txm:ana">
|
517 |
|
<xsl:value-of
|
518 |
|
select="concat(substring-after(@type,'#'),' : ',.,' ; ')" />
|
|
453 |
<xsl:for-each select="descendant::txm:ana">
|
|
454 |
<xsl:value-of select="concat(substring-after(@type,'#'),' : ',.,' ; ')"/>
|
519 |
455 |
</xsl:for-each>
|
520 |
456 |
</xsl:if>
|
521 |
457 |
</xsl:attribute>
|
522 |
|
<xsl:choose>
|
523 |
|
<xsl:when test="descendant::txm:form">
|
524 |
|
<xsl:apply-templates select="txm:form" />
|
525 |
|
</xsl:when>
|
526 |
|
<xsl:otherwise>
|
527 |
|
<xsl:apply-templates />
|
528 |
|
</xsl:otherwise>
|
529 |
|
</xsl:choose>
|
530 |
|
</xsl:otherwise>
|
531 |
|
</xsl:choose>
|
532 |
|
</span>
|
533 |
|
<xsl:call-template name="spacing" />
|
534 |
|
</xsl:template>
|
|
458 |
<xsl:choose>
|
|
459 |
<xsl:when test="descendant::txm:form">
|
|
460 |
<xsl:apply-templates select="txm:form"/>
|
|
461 |
</xsl:when>
|
|
462 |
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
|
|
463 |
</xsl:choose>
|
|
464 |
</xsl:otherwise>
|
|
465 |
</xsl:choose>
|
|
466 |
</span><xsl:call-template name="spacing"/></xsl:template>
|
|
467 |
|
|
468 |
<!-- <xsl:template match="//txm:form">
|
|
469 |
<xsl:apply-templates/>
|
|
470 |
</xsl:template>
|
|
471 |
-->
|
|
472 |
|
535 |
473 |
|
536 |
|
<!-- <xsl:template match="//txm:form"> <xsl:apply-templates/> </xsl:template> -->
|
537 |
|
|
538 |
|
|
539 |
474 |
<xsl:template name="spacing">
|
540 |
475 |
<xsl:choose>
|
541 |
476 |
<xsl:when test="$inputtype='xmltxm'">
|
542 |
|
<xsl:call-template name="spacing-xmltxm" />
|
|
477 |
<xsl:call-template name="spacing-xmltxm"/>
|
543 |
478 |
</xsl:when>
|
544 |
479 |
<xsl:otherwise>
|
545 |
|
<xsl:call-template name="spacing-xmlw" />
|
|
480 |
<xsl:call-template name="spacing-xmlw"/>
|
546 |
481 |
</xsl:otherwise>
|
547 |
482 |
</xsl:choose>
|
548 |
483 |
</xsl:template>
|
549 |
|
|
|
484 |
|
550 |
485 |
<xsl:template name="spacing-xmlw">
|
551 |
486 |
<xsl:choose>
|
552 |
|
<xsl:when test="ancestor::tei:w" />
|
553 |
|
<xsl:when
|
554 |
|
test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]" />
|
|
487 |
<xsl:when test="ancestor::tei:w"/>
|
|
488 |
<xsl:when test="following::tei:w[1][matches(.,'^\s*[.,)\]]+\s*$')]"/>
|
555 |
489 |
<xsl:when test="matches(.,'^\s*[(\[‘]+$|\w(''|’)\s*$')"></xsl:when>
|
556 |
|
<xsl:when
|
557 |
|
test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
|
|
490 |
<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
|
558 |
491 |
<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
|
559 |
|
<xsl:when
|
560 |
|
test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
|
|
492 |
<xsl:when test="following::tei:w[1][matches(.,'^\s*[:;!?]+\s*$')]">
|
561 |
493 |
<xsl:text> </xsl:text>
|
562 |
494 |
</xsl:when>
|
563 |
495 |
<xsl:otherwise>
|
564 |
496 |
<xsl:text> </xsl:text>
|
565 |
497 |
</xsl:otherwise>
|
566 |
|
</xsl:choose>
|
|
498 |
</xsl:choose>
|
567 |
499 |
</xsl:template>
|
568 |
500 |
|
569 |
501 |
<xsl:template name="spacing-xmltxm">
|
570 |
502 |
<xsl:choose>
|
571 |
|
<xsl:when test="ancestor::tei:w" />
|
572 |
|
<xsl:when
|
573 |
|
test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]" />
|
574 |
|
<xsl:when
|
575 |
|
test="matches(descendant::txm:form[1],'^[(\[‘]+$|\w(''|’)$')"></xsl:when>
|
576 |
|
<xsl:when
|
577 |
|
test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
|
|
503 |
<xsl:when test="ancestor::tei:w"/>
|
|
504 |
<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[.,)\]]+$')]"/>
|
|
505 |
<xsl:when test="matches(descendant::txm:form[1],'^[(\[‘]+$|\w(''|’)$')"></xsl:when>
|
|
506 |
<xsl:when test="position()=last() and (ancestor::tei:choice or ancestor::tei:supplied[not(@rend='multi_s')])"></xsl:when>
|
578 |
507 |
<xsl:when test="following-sibling::*[1][self::tei:note]"></xsl:when>
|
579 |
|
<xsl:when
|
580 |
|
test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
|
|
508 |
<xsl:when test="following::tei:w[1][matches(descendant::txm:form[1],'^[:;!?]+$')]">
|
581 |
509 |
<xsl:text> </xsl:text>
|
582 |
510 |
</xsl:when>
|
583 |
511 |
<xsl:otherwise>
|
584 |
512 |
<xsl:text> </xsl:text>
|
585 |
513 |
</xsl:otherwise>
|
586 |
|
</xsl:choose>
|
|
514 |
</xsl:choose>
|
587 |
515 |
</xsl:template>
|
588 |
516 |
|
589 |
|
|
|
517 |
|
590 |
518 |
</xsl:stylesheet>
|