|
32
|
1 <xsl:stylesheet version="1.0"
|
|
|
2 xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"
|
|
|
3 xmlns:xi ="http://www.w3.org/2001/XInclude"
|
|
|
4 xmlns:lang="http://www.ccel.org/info/languageCodes.xml"
|
|
|
5 xmlns:letter="http://www.ccel.org/alphabetLetters"
|
|
|
6 xmlns:str="http://exslt.org/strings"
|
|
|
7 >
|
|
|
8 <xsl:output method="html" indent="yes" encoding="UTF-8"/>
|
|
|
9
|
|
|
10 <!--
|
|
|
11 thml.html.xsl: convert a ThML document to HTML
|
|
|
12 Special processing for Text.Dictionary, Text.Daily
|
|
|
13 First version by Jimmy Osborn 2002-summer; additional work by
|
|
|
14 Wes Morgan, Jon VanHofwegen, Brian Johnson, Harry Plantinga, Matt Johnson
|
|
|
15
|
|
|
16 Parameters it understands:
|
|
|
17 sect: In server mode,
|
|
|
18 ID of divn to return.
|
|
|
19 Actually, return the divn less contained divn elements.
|
|
|
20 If id is not of a divn, returns smallest containing divn
|
|
|
21 Special values are all, toc, about, titlepage,
|
|
|
22 today (for Text.Daily docs)
|
|
|
23 Also, if _id, it returns the element whose id is given, which
|
|
|
24 could be more or less than a section.
|
|
|
25 In desktop mode, it's blank, ain't it?
|
|
|
26 debug: 1 to turn on debugging mode
|
|
|
27 notes: foot, margin, or hidden
|
|
|
28 words: if 1, add <a id="xxx"> around words for scripting
|
|
|
29 osisRef: handle osisRef request
|
|
|
30 term: for dictionary term lookup
|
|
|
31 start: for dictionary, show terms starting with this
|
|
|
32 desktop 1 for running from CCEL-Desktop
|
|
|
33 bver single bible preference for the server
|
|
|
34 ot_bib, nt_bib, ap_bib: bible preferences
|
|
|
35 -->
|
|
|
36
|
|
|
37 <!-- set up parameter defaults -->
|
|
|
38 <xsl:param name="sect">all</xsl:param>
|
|
|
39 <xsl:param name="debug"></xsl:param>
|
|
|
40 <xsl:param name="notes">foot</xsl:param>
|
|
|
41 <xsl:param name="words"></xsl:param>
|
|
|
42 <xsl:param name="bver">asv</xsl:param>
|
|
|
43 <xsl:param name="osisRef"></xsl:param>
|
|
|
44 <xsl:param name="term"></xsl:param>
|
|
|
45 <xsl:param name="start"></xsl:param>
|
|
|
46 <xsl:param name="desktop">1</xsl:param>
|
|
|
47 <xsl:param name="theText"></xsl:param>
|
|
|
48 <xsl:param name="id"></xsl:param>
|
|
|
49 <xsl:param name="word">0</xsl:param>
|
|
|
50 <xsl:param name="ot_bib"><xsl:choose>
|
|
|
51 <xsl:when test="$bver"><xsl:value-of select="$bver"/></xsl:when>
|
|
|
52 <xsl:otherwise>web</xsl:otherwise>
|
|
|
53 </xsl:choose></xsl:param>
|
|
|
54 <xsl:param name="nt_bib"><xsl:choose>
|
|
|
55 <xsl:when test="$bver"><xsl:value-of select="$bver"/></xsl:when>
|
|
|
56 <xsl:otherwise>web</xsl:otherwise>
|
|
|
57 </xsl:choose></xsl:param>
|
|
|
58 <xsl:param name="ap_bib"><xsl:choose>
|
|
|
59 <xsl:when test="$bver"><xsl:value-of select="$bver"/></xsl:when>
|
|
|
60 <xsl:otherwise>kjv</xsl:otherwise>
|
|
|
61 </xsl:choose></xsl:param>
|
|
|
62
|
|
|
63 <!-- myNotes is what we should do with notes, whether passed in by the
|
|
|
64 notes param or default (footnotes) -->
|
|
|
65 <xsl:variable name="myNotes"><xsl:choose><xsl:when test="$notes='hidden'">hidden</xsl:when><xsl:when test="$notes='margin'">margin</xsl:when><xsl:otherwise>foot</xsl:otherwise></xsl:choose></xsl:variable>
|
|
|
66
|
|
|
67 <xsl:variable name="termTrans">ABCDEFGHIJKLMNOPQRSTUVWXYZ+,;.()[]{}=</xsl:variable>
|
|
|
68
|
|
|
69 <xsl:variable name="authorID">
|
|
|
70 <xsl:choose>
|
|
|
71 <xsl:when test="/processing-instruction()[name()='thml-authorID']">
|
|
|
72 <xsl:value-of select="/processing-instruction()[name()='thml-authorID']"/>
|
|
|
73 </xsl:when>
|
|
|
74 <xsl:otherwise>
|
|
|
75 <xsl:value-of select="/ThML/ThML.head/electronicEdInfo/authorID"/>
|
|
|
76 </xsl:otherwise>
|
|
|
77 </xsl:choose>
|
|
|
78 </xsl:variable>
|
|
|
79
|
|
|
80 <xsl:variable name="bookID">
|
|
|
81 <xsl:choose>
|
|
|
82 <xsl:when test="/processing-instruction()[name()='thml-bookID']">
|
|
|
83 <xsl:value-of select="/processing-instruction()[name()='thml-bookID']"/>
|
|
|
84 </xsl:when>
|
|
|
85 <xsl:otherwise>
|
|
|
86 <xsl:value-of select="/ThML/ThML.head/electronicEdInfo/bookID"/>
|
|
|
87 </xsl:otherwise>
|
|
|
88 </xsl:choose>
|
|
|
89 </xsl:variable>
|
|
|
90
|
|
|
91 <xsl:variable name="author">
|
|
|
92 <xsl:choose>
|
|
|
93 <xsl:when test="/processing-instruction()[name()='thml-author']">
|
|
|
94 <xsl:value-of select="/processing-instruction()[name()='thml-author']"/>
|
|
|
95 </xsl:when>
|
|
|
96 <xsl:when test="/ThML/ThML.head/electronicEdInfo/DC/DC.Creator[@sub='Author' and @scheme='short-form']">
|
|
|
97 <xsl:value-of select="/ThML/ThML.head/electronicEdInfo/DC/DC.Creator[@sub='Author' and @scheme='short-form']"/>
|
|
|
98 </xsl:when>
|
|
|
99 <xsl:otherwise>
|
|
|
100 <xsl:value-of select="/ThML/ThML.head/electronicEdInfo/DC/DC.Creator[@sub='Author'
|
|
|
101 and not(@scheme)]"/>
|
|
|
102 </xsl:otherwise>
|
|
|
103 </xsl:choose>
|
|
|
104 </xsl:variable>
|
|
|
105
|
|
|
106 <xsl:variable name="title">
|
|
|
107 <xsl:choose>
|
|
|
108 <xsl:when test="/processing-instruction()[name()='thml-title']">
|
|
|
109 <xsl:value-of select="/processing-instruction()[name()='thml-title']"/>
|
|
|
110 </xsl:when>
|
|
|
111 <xsl:otherwise>
|
|
|
112 <xsl:value-of select="/ThML/ThML.head/electronicEdInfo/DC/DC.Title[not(@sub='short')]"/>
|
|
|
113 </xsl:otherwise>
|
|
|
114 </xsl:choose>
|
|
|
115 </xsl:variable>
|
|
|
116
|
|
|
117 <xsl:variable name="authLet"
|
|
|
118 select="substring($authorID,1,1)"/>
|
|
|
119 <xsl:variable name="baseURI">/ccel/<xsl:value-of
|
|
|
120 select="$authorID"/>/<xsl:value-of
|
|
|
121 select="$bookID"/></xsl:variable>
|
|
|
122 <xsl:variable name="homeURI">http://www.ccel.org<xsl:value-of
|
|
|
123 select="$baseURI"/></xsl:variable>
|
|
|
124 <xsl:variable name="xmlfile">http://www.ccel.org/<xsl:value-of
|
|
|
125 select="$authLet"/>/<xsl:value-of select="$authorID"/>/<xsl:value-of
|
|
|
126 select="$bookID"/>.xml</xsl:variable>
|
|
|
127 <xsl:variable name="homedir">http://www.ccel.org/<xsl:value-of
|
|
|
128 select="$authLet"/>/<xsl:value-of select="$authorID"/>/<xsl:value-of
|
|
|
129 select="$bookID"/></xsl:variable>
|
|
|
130
|
|
|
131 <xsl:param name="rootPath">/ccel/<xsl:value-of select="$authLet"/>/<xsl:value-of
|
|
|
132 select="$authorID"/>/<xsl:value-of select="$bookID"/>/cache/xml/</xsl:param>
|
|
|
133
|
|
|
134 <xsl:variable name="bookInfo" select="concat('/ccel/',$authLet,'/',
|
|
|
135 $authorID, '/', $bookID, '/bookInfo.xml')"/>
|
|
|
136
|
|
|
137 <xsl:variable name="ccsubj"
|
|
|
138 select="/ThML/ThML.head/electronicEdInfo/DC/DC.Subject[@scheme='ccel']"/>
|
|
|
139
|
|
|
140 <!-- headtitle is used on left side of navbar -->
|
|
|
141 <xsl:variable name="shorttitle"
|
|
|
142 select="/ThML/ThML.head/electronicEdInfo/DC/DC.Title[@sub='short']"/>
|
|
|
143 <xsl:variable name="headtitle"><xsl:choose><xsl:when test="$shorttitle"><xsl:value-of select="$shorttitle"/></xsl:when><xsl:otherwise><xsl:value-of select="$title"/></xsl:otherwise></xsl:choose></xsl:variable>
|
|
|
144 <xsl:variable name="titlepage" select="/ThML/ThML.body/div1[1]"/>
|
|
|
145 <xsl:variable name="titlepageID" select="$titlepage/@id"/>
|
|
|
146 <xsl:param name="progress">0%</xsl:param>
|
|
|
147
|
|
|
148 <!-- this is the ID of the requested element. -->
|
|
|
149 <xsl:variable name="mySectID">
|
|
|
150 <xsl:choose>
|
|
|
151 <xsl:when test="$osisRef != ''">
|
|
|
152 <xsl:value-of select="$osisRef"/>
|
|
|
153 </xsl:when>
|
|
|
154 <xsl:when test="$sect='titlepage'">
|
|
|
155 <xsl:value-of select="/ThML/ThML.body/div1[1]/@id"/>
|
|
|
156 </xsl:when>
|
|
|
157 <xsl:when test="substring($sect,1,1)='_'">
|
|
|
158 <xsl:value-of select="substring($sect,2)"/>
|
|
|
159 </xsl:when>
|
|
|
160 <xsl:when test="/processing-instruction()[name()='thml-sect']">
|
|
|
161 <xsl:value-of select="/processing-instruction()[name()='thml-sect']"/>
|
|
|
162 </xsl:when>
|
|
|
163 <xsl:otherwise>
|
|
|
164 <xsl:value-of select="$sect"/>
|
|
|
165 </xsl:otherwise>
|
|
|
166 </xsl:choose>
|
|
|
167 </xsl:variable>
|
|
|
168
|
|
|
169
|
|
|
170 <xsl:variable name="theElt" select="/ThML/ThML.body//*[@id = $mySectID]"/>
|
|
|
171
|
|
|
172 <!-- this is the ID of the sect (divn) containing the requested element -->
|
|
|
173 <xsl:variable name="theDivID">
|
|
|
174 <xsl:choose>
|
|
|
175 <xsl:when test="$sect='all'"></xsl:when>
|
|
|
176 <xsl:when test="$theElt[name()='div1'] or $theElt[name()='div2'] or
|
|
|
177 $theElt[name()='div3'] or $theElt[name()='div4'] or
|
|
|
178 $theElt[name()='div5']">
|
|
|
179 <xsl:value-of select="$mySectID"/>
|
|
|
180 </xsl:when>
|
|
|
181 <xsl:otherwise>
|
|
|
182 <xsl:value-of select="$theElt/ancestor::div5/@id|$theElt/ancestor::div4/@id|$theElt/ancestor::div3/@id|$theElt/ancestor::div2/@id|$theElt/ancestor::div1/@id[last()]"/>
|
|
|
183 </xsl:otherwise>
|
|
|
184 </xsl:choose>
|
|
|
185 </xsl:variable>
|
|
|
186
|
|
|
187
|
|
|
188 <!-- for osisRefs
|
|
|
189 - delete any + and rest of osisRef string
|
|
|
190 - delete any - and rest of osisRef string
|
|
|
191 - get the ID of <scripture osisDI="..." or <scripCom osisRef="..."
|
|
|
192 -->
|
|
|
193
|
|
|
194 <xsl:variable name="osisRefOne">
|
|
|
195 <xsl:choose>
|
|
|
196 <xsl:when test="contains($osisRef,'+')"><xsl:value-of
|
|
|
197 select="substring-before($osisRef,'+')"/></xsl:when>
|
|
|
198 <xsl:otherwise><xsl:value-of select="$osisRef"/></xsl:otherwise>
|
|
|
199 </xsl:choose>
|
|
|
200 </xsl:variable>
|
|
|
201 <xsl:variable name="osisRefStart">
|
|
|
202 <xsl:choose>
|
|
|
203 <xsl:when test="contains($osisRef,'-')"><xsl:value-of
|
|
|
204 select="substring-before($osisRef,'-')"/></xsl:when>
|
|
|
205 <xsl:otherwise><xsl:value-of select="$osisRef"/></xsl:otherwise>
|
|
|
206 </xsl:choose>
|
|
|
207 </xsl:variable>
|
|
|
208
|
|
|
209 <xsl:variable name="osisRefID">
|
|
|
210 <xsl:choose>
|
|
|
211 <xsl:when test="$osisRefStart=''"></xsl:when>
|
|
|
212 <xsl:otherwise>
|
|
|
213 <xsl:value-of
|
|
|
214 select="//scripture[@osisID=$osisRefStart]/@id|//scripCom[contains(@osisRef,$osisRefStart)]/@id"/>
|
|
|
215 </xsl:otherwise>
|
|
|
216 </xsl:choose>
|
|
|
217 </xsl:variable>
|
|
|
218 <xsl:variable name="osisSect">
|
|
|
219 <xsl:value-of select="substring-before($osisRefID,'-')"/>
|
|
|
220 </xsl:variable>
|
|
|
221
|
|
|
222 <!-- 'in' means #id urls, 'ex' means bookID.id.html urls -->
|
|
|
223 <xsl:variable name="urls">
|
|
|
224 <xsl:choose>
|
|
|
225 <xsl:when test="$mySectID='all' and $desktop!=1 and $osisRef=''">in</xsl:when>
|
|
|
226 <xsl:otherwise>ex</xsl:otherwise>
|
|
|
227 </xsl:choose>
|
|
|
228 </xsl:variable>
|
|
|
229
|
|
|
230 <xsl:variable name="urlPrefix">
|
|
|
231 <xsl:choose>
|
|
|
232 <xsl:when test="$urls='in'">#</xsl:when>
|
|
|
233 <xsl:otherwise><xsl:value-of select="$bookID"/>.</xsl:otherwise>
|
|
|
234 </xsl:choose>
|
|
|
235 </xsl:variable>
|
|
|
236 <xsl:variable name="urlSuffix">
|
|
|
237 <xsl:choose>
|
|
|
238 <xsl:when test="$urls='in'"></xsl:when>
|
|
|
239 <xsl:otherwise>.html<!--<xsl:value-of select="$params"/>--></xsl:otherwise>
|
|
|
240 </xsl:choose>
|
|
|
241 </xsl:variable>
|
|
|
242 <xsl:variable name="tocURL">
|
|
|
243 <xsl:value-of select="concat($urlPrefix,'toc',$urlSuffix)"/>
|
|
|
244 </xsl:variable>
|
|
|
245 <xsl:variable name="aboutURL">
|
|
|
246 <xsl:value-of select="concat($bookID,$urlSuffix)"/>
|
|
|
247 </xsl:variable>
|
|
|
248 <xsl:variable name="titlepageURL">
|
|
|
249 <xsl:choose>
|
|
|
250 <xsl:when test="$mySectID='all'">#<xsl:value-of select="$titlepageID"/></xsl:when>
|
|
|
251 <xsl:otherwise><xsl:value-of select="concat($urlPrefix,'titlepage',$urlSuffix)"/></xsl:otherwise>
|
|
|
252 </xsl:choose>
|
|
|
253 </xsl:variable>
|
|
|
254 <xsl:variable name="cssURL">
|
|
|
255 <xsl:choose>
|
|
|
256 <xsl:when test="$sect='all'"><xsl:value-of select="$homeURI"/>.css</xsl:when>
|
|
|
257 <xsl:otherwise><xsl:value-of select="$bookID"/>.css</xsl:otherwise>
|
|
|
258 </xsl:choose>
|
|
|
259 </xsl:variable>
|
|
|
260
|
|
|
261 <!--Is this book a Text.Dictionary?-->
|
|
|
262 <xsl:variable name="isDict">
|
|
|
263 <xsl:choose>
|
|
|
264 <xsl:when test="/ThML/ThML.head/electronicEdInfo/DC/DC.Type='Text.Dictionary'">1</xsl:when>
|
|
|
265 <xsl:when test="processing-instruction('thml-dctype')='Text.Dictionary'">1</xsl:when>
|
|
|
266 <xsl:otherwise></xsl:otherwise>
|
|
|
267 </xsl:choose>
|
|
|
268 </xsl:variable>
|
|
|
269
|
|
|
270 <xsl:variable name="myTerm">
|
|
|
271 <xsl:variable name="temp">
|
|
|
272 <xsl:call-template name="url-decode">
|
|
|
273 <xsl:with-param name="encoded" select="$term"/>
|
|
|
274 </xsl:call-template>
|
|
|
275 </xsl:variable>
|
|
|
276 <xsl:value-of select = "translate($temp,$termTrans,'abcdefghijklmnopqrstuvwxyz ')"/>
|
|
|
277 </xsl:variable>
|
|
|
278
|
|
|
279
|
|
|
280 <!--Is this book a Text.Daily?-->
|
|
|
281 <xsl:variable name="isDaily">
|
|
|
282 <xsl:choose>
|
|
|
283 <xsl:when test="/ThML/ThML.head/electronicEdInfo/DC/DC.Type='Text.Daily'">1</xsl:when>
|
|
|
284 <xsl:when test="processing-instruction('thml-dctype')='Text.Daily'">1</xsl:when>
|
|
|
285 <xsl:otherwise>0</xsl:otherwise>
|
|
|
286 </xsl:choose>
|
|
|
287 </xsl:variable>
|
|
|
288
|
|
|
289
|
|
|
290 <!-- ============================================================== -->
|
|
|
291 <!-- ThML template: do outer stuff, then call appropriate templates -->
|
|
|
292 <!-- ============================================================== -->
|
|
|
293 <xsl:template match="/">
|
|
|
294 <xsl:if test="$debug">
|
|
|
295 <xsl:message>rootPath: <xsl:value-of select="$rootPath"/></xsl:message>
|
|
|
296 <xsl:message>desktop: <xsl:value-of select="$desktop"/></xsl:message>
|
|
|
297 <xsl:message>authorID: <xsl:value-of select="$authorID"/></xsl:message>
|
|
|
298 <xsl:message>bookID: <xsl:value-of select="$bookID"/></xsl:message>
|
|
|
299 <xsl:message>title: <xsl:value-of select="$title"/></xsl:message>
|
|
|
300 <xsl:message>bookInfo: <xsl:value-of select="$bookInfo"/></xsl:message>
|
|
|
301 <xsl:message>ccsubj: <xsl:value-of select="$ccsubj"/></xsl:message>
|
|
|
302 <xsl:message>head: <xsl:value-of select="$headtitle"/></xsl:message>
|
|
|
303 <xsl:message>author: <xsl:value-of select="$author"/></xsl:message>
|
|
|
304 <xsl:message>notes: <xsl:value-of select="$myNotes"/></xsl:message>
|
|
|
305 <xsl:message>sect: <xsl:value-of select="$sect"/></xsl:message>
|
|
|
306 <xsl:message>mySectID: <xsl:value-of select="$mySectID"/></xsl:message>
|
|
|
307 <xsl:message>osisRef: <xsl:value-of select="$osisRef"/></xsl:message>
|
|
|
308 <xsl:message>urls: <xsl:value-of select="$urls"/></xsl:message>
|
|
|
309 <xsl:message>urlPrefix: <xsl:value-of select="$urlPrefix"/></xsl:message>
|
|
|
310 <xsl:message>tocURL: <xsl:value-of select="$tocURL"/></xsl:message>
|
|
|
311 <xsl:message>aboutURL: <xsl:value-of select="$aboutURL"/></xsl:message>
|
|
|
312 <xsl:message>theElt: <xsl:value-of select="$theElt/@id"/></xsl:message>
|
|
|
313 <xsl:message>theDivID: <xsl:value-of select="$theDivID"/></xsl:message>
|
|
|
314 <xsl:message>isDict: <xsl:value-of select="$isDict"/></xsl:message>
|
|
|
315 <xsl:message>term: <xsl:value-of select="$term"/></xsl:message>
|
|
|
316 <xsl:message>myTerm: <xsl:value-of select="$myTerm"/></xsl:message>
|
|
|
317 </xsl:if>
|
|
|
318
|
|
|
319 <html>
|
|
|
320 <head>
|
|
|
321 <title><xsl:value-of select="$title"/> (<xsl:value-of select="translate($mySectID,'+',' ')"/>)</title>
|
|
|
322 <link rel="stylesheet" type="text/css" href="/ss/ThML10.css"/>
|
|
|
323
|
|
|
324 <!-- stylesheet -->
|
|
|
325 <xsl:choose>
|
|
|
326 <xsl:when test="$sect='all' and not(/processing-instruction()[name()='thml-authorID'])">
|
|
|
327 <style type="text/css">
|
|
|
328 <xsl:value-of select="/ThML/ThML.head/style[@type='text/css']"/>
|
|
|
329 </style>
|
|
|
330 </xsl:when>
|
|
|
331 <xsl:otherwise>
|
|
|
332 <link rel="stylesheet" type="text/css" href="{$bookID}.css"/>
|
|
|
333 </xsl:otherwise>
|
|
|
334 </xsl:choose>
|
|
|
335
|
|
|
336 <!-- add javascript for isDaily documents -->
|
|
|
337 <xsl:if test="$isDaily=1">
|
|
|
338 <script language="javascript" type="text/javascript">
|
|
|
339 function goToday() {
|
|
|
340 var d = new Date();
|
|
|
341 var theloc = "d";
|
|
|
342 if (d.getMonth() < 9) theloc += "0";
|
|
|
343 theloc += String(d.getMonth() +1);
|
|
|
344 if (d.getDate() < 10) theloc += "0";
|
|
|
345 theloc += String(d.getDate());
|
|
|
346
|
|
|
347 <xsl:if test="$bookID='morneve'">
|
|
|
348 if (d.getHours() < 12) theloc += "am";
|
|
|
349 else theloc += "pm";
|
|
|
350 </xsl:if>
|
|
|
351 <xsl:choose>
|
|
|
352 <xsl:when test="$urls='in'">
|
|
|
353 self.location = "#" + theloc;
|
|
|
354 </xsl:when>
|
|
|
355 <xsl:otherwise>
|
|
|
356 self.location = "<xsl:value-of select="$bookID"/>." +
|
|
|
357 theloc + ".html";
|
|
|
358 </xsl:otherwise>
|
|
|
359 </xsl:choose>
|
|
|
360 return false;
|
|
|
361 }
|
|
|
362
|
|
|
363 function goDay(month,day) {
|
|
|
364 var m=month.value;
|
|
|
365 var da = day.value;
|
|
|
366 var d = new Date();
|
|
|
367 var theloc = "d";
|
|
|
368 if (((m=="04" || m=="06" || m=="09" || m=="11") && da=="31") || (m=="02" && (da=="30" || da=="31"))) {
|
|
|
369 alert("Invalid date! Try again.");
|
|
|
370 return false;
|
|
|
371 }
|
|
|
372 theloc += String(m) + String(da);
|
|
|
373 <xsl:if test="$bookID='morneve'">
|
|
|
374 if (d.getHours() < 12) theloc += "am";
|
|
|
375 else theloc += "pm";
|
|
|
376 </xsl:if>
|
|
|
377 <xsl:choose>
|
|
|
378 <xsl:when test="$urls='in'">
|
|
|
379 self.location = "#" + theloc;
|
|
|
380 </xsl:when>
|
|
|
381 <xsl:otherwise>
|
|
|
382 self.location = "<xsl:value-of select="$bookID"/>." +
|
|
|
383 theloc + ".html";
|
|
|
384 </xsl:otherwise>
|
|
|
385 </xsl:choose>
|
|
|
386 return false;
|
|
|
387 }
|
|
|
388 </script>
|
|
|
389 </xsl:if>
|
|
|
390 </head>
|
|
|
391
|
|
|
392 <body>
|
|
|
393 <xsl:attribute name="onLoad">init.call(); highlightSearch();</xsl:attribute>
|
|
|
394 <xsl:if test="$isDaily=1 and $sect='today'">
|
|
|
395 <script>
|
|
|
396 goToday();
|
|
|
397 </script>
|
|
|
398 </xsl:if>
|
|
|
399 <script language="javascript" type="text/javascript" src="/ss/util-dom.js"></script>
|
|
|
400 <script language="javascript" type="text/javascript" src="/ss/highlight.js"></script>
|
|
|
401 <xsl:choose>
|
|
|
402 <xsl:when test="$osisRef != ''">
|
|
|
403 <xsl:apply-templates select="/ThML/ThML.body/div1[@id=$osisSect] |
|
|
|
404 /ThML/ThML.body/div1/div2[@id=$osisSect] |
|
|
|
405 /ThML/ThML.body/div1/div2/div3[@id=$osisSect] |
|
|
|
406 /ThML/ThML.body/div1/div2/div3/div4[@id=$osisSect] |
|
|
|
407 /ThML/ThML.body/div1/div2/div3/div4/div5[@id=$osisSect]"
|
|
|
408 mode="includeParsing"/>
|
|
|
409 </xsl:when>
|
|
|
410
|
|
|
411 <!-- for a term request on server, which says section is about -->
|
|
|
412 <!--
|
|
|
413 <xsl:when test="$desktop!='1' and $myTerm != ''">
|
|
|
414 <xsl:apply-templates select="/ThML/ThML.body/div1/div2[@id='a']/glossary" mode="dict"/>
|
|
|
415 </xsl:when>
|
|
|
416 -->
|
|
|
417
|
|
|
418 <xsl:when test="$mySectID='about'">
|
|
|
419 <xsl:apply-templates select="/ThML/ThML.head|ThML.head" mode="includeParsing"/>
|
|
|
420 </xsl:when>
|
|
|
421
|
|
|
422 <!-- here for dictBookID.html?term=myTerm -->
|
|
|
423 <xsl:when test="$mySectID='toc' and $myTerm!=''">
|
|
|
424 <xsl:variable name="filename">
|
|
|
425 <xsl:if test="$desktop='1'"><xsl:text>../books/</xsl:text></xsl:if>
|
|
|
426 <xsl:if test="$desktop='0'"><xsl:text>/ccel/</xsl:text></xsl:if>
|
|
|
427 <xsl:value-of
|
|
|
428 select="$authLet"/>/<xsl:value-of
|
|
|
429 select="$authorID"/>/<xsl:value-of
|
|
|
430 select="$bookID"/>/xml/<xsl:value-of
|
|
|
431 select="$bookID"/>.<xsl:value-of
|
|
|
432 select="substring($myTerm,1,1)"/>.xml</xsl:variable>
|
|
|
433 <xsl:apply-templates select="document($filename,$rootPath)//glossary"
|
|
|
434 mode="dict"/>
|
|
|
435 </xsl:when>
|
|
|
436
|
|
|
437 <xsl:when test="$mySectID='toc'">
|
|
|
438 <xsl:apply-templates select="/ThML/ThML.body|ThML.body" mode="includeParsing"/>
|
|
|
439 </xsl:when>
|
|
|
440
|
|
|
441 <xsl:when test="substring($sect,1,1)='_'">
|
|
|
442 <xsl:apply-templates select="$theElt" mode="includeParsing"/>
|
|
|
443 </xsl:when>
|
|
|
444
|
|
|
445 <xsl:when test="$theDivID != '' and $start=''">
|
|
|
446 <xsl:apply-templates select="/ThML/ThML.body/div1[@id=$theDivID] |
|
|
|
447 /ThML/ThML.body/div1/div2[@id=$theDivID] |
|
|
|
448 /ThML/ThML.body/div1/div2/div3[@id=$theDivID] |
|
|
|
449 /ThML/ThML.body/div1/div2/div3/div4[@id=$theDivID] |
|
|
|
450 /ThML/ThML.body/div1/div2/div3/div4/div5[@id=$theDivID]"
|
|
|
451 mode="includeParsing"/>
|
|
|
452 </xsl:when>
|
|
|
453
|
|
|
454 <xsl:when test="$sect='today' and $isDaily=1">
|
|
|
455 <h1>Going to today's reading...</h1>
|
|
|
456 </xsl:when>
|
|
|
457
|
|
|
458 <xsl:when test="$isDict=1 and ($myTerm!='' or $start!='')">
|
|
|
459 <xsl:if test="$myTerm!=''">
|
|
|
460 <xsl:choose>
|
|
|
461 <xsl:when test="//glossary/term[translate(.,
|
|
|
462 $termTrans,
|
|
|
463 'abcdefghijklmnopqrstuvwxyz ')=$myTerm]">
|
|
|
464 <xsl:call-template name="dictTerm" />
|
|
|
465 </xsl:when>
|
|
|
466 <xsl:otherwise>
|
|
|
467 <xsl:call-template name="dictTermNotFound"/>
|
|
|
468 </xsl:otherwise>
|
|
|
469 </xsl:choose>
|
|
|
470 </xsl:if>
|
|
|
471 <xsl:if test="$start!=''">
|
|
|
472 <xsl:call-template name="dictStart" />
|
|
|
473 </xsl:if>
|
|
|
474 </xsl:when>
|
|
|
475
|
|
|
476 <xsl:otherwise> <!-- $sect should be 'all' -->
|
|
|
477 <xsl:apply-templates select="*" mode="includeParsing"/>
|
|
|
478 <xsl:apply-templates select="/ThML/ThML.body/*" mode="includeParsing"/>
|
|
|
479 </xsl:otherwise>
|
|
|
480
|
|
|
481 </xsl:choose>
|
|
|
482
|
|
|
483 <xsl:if test="substring($sect,1,1) != '_'">
|
|
|
484 <xsl:call-template name="add-footer"/>
|
|
|
485 </xsl:if>
|
|
|
486
|
|
|
487 </body>
|
|
|
488 </html>
|
|
|
489 </xsl:template>
|
|
|
490
|
|
|
491
|
|
|
492 <!-- ================================================================ -->
|
|
|
493 <!-- divn template: if $sect=all, process all divs, else only -->
|
|
|
494 <!-- requested one(s). Handle navbar and notes, then apply-templates. -->
|
|
|
495 <!-- ================================================================ -->
|
|
|
496 <xsl:template match="div1|div2|div3|div4|div5|div[@type='sect']" mode="includeParsing">
|
|
|
497 <xsl:if test="($sect='all' or @id=$theDivID or @id=$osisSect)">
|
|
|
498 <xsl:call-template name="navbar">
|
|
|
499 <xsl:with-param name="progress" select="@progress"/>
|
|
|
500 </xsl:call-template>
|
|
|
501 <a name="navtop" id="navtop"/>
|
|
|
502 <xsl:apply-templates mode="includeParsing" />
|
|
|
503 <xsl:if test="./p//note and $myNotes='foot'">
|
|
|
504 <hr class="Note" id="noteBottom"/>
|
|
|
505 </xsl:if>
|
|
|
506 <xsl:if test=".//note and $myNotes='foot'">
|
|
|
507 <xsl:apply-templates select="./*" mode="createNotes"/>
|
|
|
508 </xsl:if>
|
|
|
509 <a name="navbottom" id="navbottom"/>
|
|
|
510 <xsl:call-template name="navbar">
|
|
|
511 <xsl:with-param name="progress" select="@progress"/>
|
|
|
512 </xsl:call-template>
|
|
|
513 </xsl:if>
|
|
|
514 </xsl:template>
|
|
|
515
|
|
|
516
|
|
|
517 <!-- ============================================================ -->
|
|
|
518 <!-- Generate a spiffy Table of Contents with expandable outline. -->
|
|
|
519 <!-- ============================================================ -->
|
|
|
520 <xsl:template match="ThML.body" name="toc" mode="includeParsing">
|
|
|
521 <table id="bcbHide" bgcolor="#660000" style="margin-top:24pt; width:100%">
|
|
|
522 <tr><td><p class="whitehead" style="text-align:center"><xsl:value-of
|
|
|
523 select="$title"/> - Table of Contents</p></td></tr>
|
|
|
524 </table>
|
|
|
525 <h1 class="title"><xsl:value-of select="$title"/></h1>
|
|
|
526 <h3 class="subhead">by</h3>
|
|
|
527 <h2 class="subhead"><xsl:value-of select="$author"/></h2>
|
|
|
528 <hr width="30%"/>
|
|
|
529 <div style="text-align:center; margin-left:0.5in; margin-right:0.5in">
|
|
|
530 <table align="center"><tr><td>
|
|
|
531 <h1 class="title" id="toc">Table of Contents</h1>
|
|
|
532 <xsl:if test="$isDaily=1">
|
|
|
533 <p class="TOC1" style="text-align:center">
|
|
|
534 <form onsubmit="return goToday()">
|
|
|
535 <input type="submit" value="Go to today"/>
|
|
|
536 </form>
|
|
|
537 </p>
|
|
|
538 <p class="TOC1" style="text-align:center">
|
|
|
539 <form onsubmit="return goDay(month,day)">
|
|
|
540 <select name="month">
|
|
|
541 <option value="01">January</option>
|
|
|
542 <option value="02">February</option>
|
|
|
543 <option value="03">March</option>
|
|
|
544 <option value="04">April</option>
|
|
|
545 <option value="05">May</option>
|
|
|
546 <option value="06">June</option>
|
|
|
547 <option value="07">July</option>
|
|
|
548 <option value="08">August</option>
|
|
|
549 <option value="09">September</option>
|
|
|
550 <option value="10">October</option>
|
|
|
551 <option value="11">November</option>
|
|
|
552 <option value="12">December</option>
|
|
|
553 </select>
|
|
|
554 <select name="day">
|
|
|
555 <option value="01">1</option>
|
|
|
556 <option value="02">2</option>
|
|
|
557 <option value="03">3</option>
|
|
|
558 <option value="04">4</option>
|
|
|
559 <option value="05">5</option>
|
|
|
560 <option value="06">6</option>
|
|
|
561 <option value="07">7</option>
|
|
|
562 <option value="08">8</option>
|
|
|
563 <option value="09">9</option>
|
|
|
564 <option value="10">10</option>
|
|
|
565 <option value="11">11</option>
|
|
|
566 <option value="12">12</option>
|
|
|
567 <option value="13">13</option>
|
|
|
568 <option value="14">14</option>
|
|
|
569 <option value="15">15</option>
|
|
|
570 <option value="16">16</option>
|
|
|
571 <option value="17">17</option>
|
|
|
572 <option value="18">18</option>
|
|
|
573 <option value="19">19</option>
|
|
|
574 <option value="20">20</option>
|
|
|
575 <option value="21">21</option>
|
|
|
576 <option value="22">22</option>
|
|
|
577 <option value="23">23</option>
|
|
|
578 <option value="24">24</option>
|
|
|
579 <option value="25">25</option>
|
|
|
580 <option value="26">26</option>
|
|
|
581 <option value="27">27</option>
|
|
|
582 <option value="28">28</option>
|
|
|
583 <option value="29">29</option>
|
|
|
584 <option value="30">30</option>
|
|
|
585 <option value="31">31</option>
|
|
|
586 </select>
|
|
|
587 <input type="submit" value="Go to day..."/>
|
|
|
588 </form>
|
|
|
589 </p>
|
|
|
590 </xsl:if>
|
|
|
591 <p class="TOC1" style="text-align:center">
|
|
|
592 <a bcbTarg="true" class="TOC" href="{$aboutURL}">
|
|
|
593 <i>About This Book</i>
|
|
|
594 </a>
|
|
|
595 </p>
|
|
|
596 <xsl:apply-templates select="div1[1]" mode="tocRequestDom1"/>
|
|
|
597 <p id="bcbHide" style="text-indent:0in;margin-top:12pt">
|
|
|
598 <a href="/files/nav.htm">Navigation and searching hints</a>
|
|
|
599 </p>
|
|
|
600 <xsl:if test="$isDict=1">
|
|
|
601 <p id="bcbHide" style="text-indent:0in;margin-top:12pt">
|
|
|
602 <form action="/termSearch">
|
|
|
603
|
|
|
604 Look up an entry:
|
|
|
605 <input type="text" name="q"/>
|
|
|
606 <input type="hidden" name="authorID" value="{$authorID}"/>
|
|
|
607 <input type="hidden" name="bookID" value="{$bookID}"/>
|
|
|
608 <input type="submit" value="Search"/>
|
|
|
609 </form>
|
|
|
610 </p>
|
|
|
611 <p class="nav">
|
|
|
612 <xsl:for-each select="document('')/*/letter:alphabet/letter:letter">
|
|
|
613 <a class="TOC" href="/termSearch?authorID={$authorID}&bookID={$bookID}&q={.}"><xsl:value-of select="translate(., 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" /></a><xsl:text> </xsl:text>
|
|
|
614 </xsl:for-each>
|
|
|
615 </p></xsl:if>
|
|
|
616 </td></tr></table>
|
|
|
617 </div>
|
|
|
618 <hr id="bcbHide"/>
|
|
|
619 </xsl:template>
|
|
|
620
|
|
|
621 <xsl:template match="div1|div2|div3|div4|div5" mode="tocRequestDom1">
|
|
|
622 <xsl:variable name="unique" select="@id"/>
|
|
|
623 <div>
|
|
|
624 <xsl:choose>
|
|
|
625 <xsl:when test="local-name(.) = 'div1'">
|
|
|
626 <xsl:attribute name="style">display:block</xsl:attribute>
|
|
|
627 </xsl:when>
|
|
|
628 <xsl:otherwise>
|
|
|
629 <xsl:attribute name="style">display:none</xsl:attribute>
|
|
|
630 </xsl:otherwise>
|
|
|
631 </xsl:choose>
|
|
|
632 <xsl:attribute name="id">d<xsl:value-of select="$unique"/></xsl:attribute>
|
|
|
633 <xsl:apply-templates select=".|following-sibling::div1|following-sibling::div2|following-sibling::div3|following-sibling::div4|following-sibling::div5" mode="tocFillDivDom1"/>
|
|
|
634 </div>
|
|
|
635 </xsl:template>
|
|
|
636
|
|
|
637 <xsl:template match="div1|div2|div3|div4|div5" mode="tocFillDivDom1">
|
|
|
638 <xsl:variable name="level">
|
|
|
639 <xsl:value-of select="substring-after(local-name(.), 'div')"/>
|
|
|
640 </xsl:variable>
|
|
|
641 <p class="{concat('TOC', $level)}">
|
|
|
642 <xsl:if test="boolean(div2|div3|div4|div5)">
|
|
|
643 <xsl:variable name="nextUnique" select="div2/@id|div3/@id|div4/@id|div5/@id"/>
|
|
|
644 <a>
|
|
|
645 <xsl:attribute name="href">javascript:t('d<xsl:value-of select="$nextUnique"/>','p<xsl:value-of select="$nextUnique"/>')</xsl:attribute>
|
|
|
646 <img alt="Click to expand or collapse this item" title="Click to expand or collapse this item" name="imEx" border="0" src="/pix/shut.gif" onmouseover="javascript:highlight(this)" onmouseout="javascript:unhighlight(this)">
|
|
|
647 <xsl:attribute name="id">p<xsl:value-of select="$nextUnique"/></xsl:attribute>
|
|
|
648 </img>
|
|
|
649 </a> 
|
|
|
650 </xsl:if>
|
|
|
651 <a bcbParam="true" class="TOC" href="{$urlPrefix}{@id}{$urlSuffix}">
|
|
|
652 <xsl:value-of select="@title"/>
|
|
|
653 </a>
|
|
|
654 </p>
|
|
|
655 <xsl:apply-templates
|
|
|
656 select="div2[1]|div3[1]|div4[1]|div5[1]" mode="tocRequestDom1"/>
|
|
|
657 </xsl:template>
|
|
|
658
|
|
|
659
|
|
|
660 <!-- ====================================================== -->
|
|
|
661 <!-- Create a list of dictionary terms starting with $start -->
|
|
|
662 <!-- ====================================================== -->
|
|
|
663 <xsl:template name="dictStart">
|
|
|
664 <xsl:variable name="firstletter" select="substring($start,1,1)" />
|
|
|
665 <xsl:variable name="prev1">
|
|
|
666 <xsl:choose>
|
|
|
667 <xsl:when test="string-length($start) != 1">
|
|
|
668 <xsl:value-of select="substring($start,1,1)" />
|
|
|
669 </xsl:when>
|
|
|
670 <xsl:otherwise>
|
|
|
671 <xsl:value-of select="translate($start,
|
|
|
672 'abcdefghijklmnopqrstuvwxyz','zabcdefghijklmnopqrstuvwxy')"/>
|
|
|
673 </xsl:otherwise>
|
|
|
674 </xsl:choose>
|
|
|
675 </xsl:variable>
|
|
|
676 <xsl:variable name="next1">
|
|
|
677 <xsl:choose>
|
|
|
678 <xsl:when test="string-length($start) != 1">
|
|
|
679 <xsl:value-of select="substring($start,1,1)" />
|
|
|
680 </xsl:when>
|
|
|
681 <xsl:otherwise>
|
|
|
682 <xsl:value-of select="translate($start,
|
|
|
683 'abcdefghijklmnopqrstuvwxyz','bcdefghijklmnopqrstuvwxyza')"/>
|
|
|
684 </xsl:otherwise>
|
|
|
685 </xsl:choose>
|
|
|
686 </xsl:variable>
|
|
|
687
|
|
|
688 <xsl:call-template name="navbar">
|
|
|
689 <xsl:with-param name="prev" select="$prev1" />
|
|
|
690 <xsl:with-param name="prevParam">?start=<xsl:value-of
|
|
|
691 select="$prev1" /></xsl:with-param>
|
|
|
692 <xsl:with-param name="next" select="$next1" />
|
|
|
693 <xsl:with-param name="nextParam">?start=<xsl:value-of
|
|
|
694 select="$next1" /></xsl:with-param>
|
|
|
695 </xsl:call-template>
|
|
|
696
|
|
|
697 <h3>Terms starting with <xsl:value-of select="translate($start,
|
|
|
698 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')" /></h3>
|
|
|
699 <ul>
|
|
|
700 <xsl:for-each select="//glossary/term[translate(substring(.,1,
|
|
|
701 string-length($start)), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
|
702 'abcdefghijklmnopqrstuvwxyz')=$start]">
|
|
|
703 <xsl:variable name="first1" select="substring($start,1,1)"/>
|
|
|
704
|
|
|
705 <li><a href="{$bookID}.{$first1}.html?term={translate(.,' ,;',
|
|
|
706 '+')}"><xsl:value-of select="."/></a></li>
|
|
|
707 </xsl:for-each>
|
|
|
708 </ul>
|
|
|
709 </xsl:template>
|
|
|
710
|
|
|
711
|
|
|
712 <!-- ========================================== -->
|
|
|
713 <!-- Create a dictionary term page for $myTerm -->
|
|
|
714 <!-- ========================================== -->
|
|
|
715 <xsl:template match="*" mode="dict">
|
|
|
716 <xsl:choose>
|
|
|
717 <xsl:when test="//glossary/term[translate(.,$termTrans,
|
|
|
718 'abcdefghijklmnopqrstuvwxyz ')=$myTerm]">
|
|
|
719 <xsl:call-template name="dictTerm" />
|
|
|
720 </xsl:when>
|
|
|
721 <xsl:otherwise>
|
|
|
722 <xsl:call-template name="dictTermNotFound"/>
|
|
|
723 </xsl:otherwise>
|
|
|
724 </xsl:choose>
|
|
|
725 </xsl:template>
|
|
|
726
|
|
|
727 <xsl:template name="dictTerm">
|
|
|
728 <xsl:variable name="termNode" select="//glossary/term[translate(.,$termTrans,
|
|
|
729 'abcdefghijklmnopqrstuvwxyz ')=$myTerm]"/>
|
|
|
730
|
|
|
731 <xsl:call-template name="navbar">
|
|
|
732 <xsl:with-param name="prev"
|
|
|
733 select="translate(substring($termNode/preceding::term[1],1,1),
|
|
|
734 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />
|
|
|
735 <xsl:with-param name="prevParam">
|
|
|
736 <xsl:if test="$termNode/preceding::term[1]">?term=<xsl:call-template name="url-encode">
|
|
|
737 <xsl:with-param name="str" select="$termNode/preceding::term[1]" /></xsl:call-template></xsl:if>
|
|
|
738 </xsl:with-param>
|
|
|
739 <xsl:with-param name="next"
|
|
|
740 select="translate(substring($termNode/following::term[1],1,1),
|
|
|
741 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />
|
|
|
742 <xsl:with-param name="nextParam">
|
|
|
743 <xsl:if test="$termNode/following::term[1]">?term=<xsl:call-template name="url-encode">
|
|
|
744 <xsl:with-param name="str" select="$termNode/following::term[1]" /></xsl:call-template></xsl:if>
|
|
|
745 </xsl:with-param>
|
|
|
746 </xsl:call-template>
|
|
|
747 <a name="navtop" id="navtop"/>
|
|
|
748
|
|
|
749 <dl>
|
|
|
750 <b><xsl:apply-templates select="$termNode" mode="includeParsing"/></b>
|
|
|
751 <xsl:apply-templates select="$termNode/following-sibling::def[1]"
|
|
|
752 mode="includeParsing"/>
|
|
|
753 </dl>
|
|
|
754
|
|
|
755 <xsl:if test="string-length($myTerm) > 2">
|
|
|
756 <xsl:if test="count(//glossary/term[contains(translate(.,
|
|
|
757 $termTrans,'abcdefghijklmnopqrstuvwxyz '),
|
|
|
758 $myTerm)]) > 1">
|
|
|
759 <h5>Or did you want:</h5>
|
|
|
760 <ul>
|
|
|
761 <xsl:for-each select="//glossary/term[contains(translate(.,
|
|
|
762 $termTrans,'abcdefghijklmnopqrstuvwxyz '),
|
|
|
763 $myTerm) and not(translate(., $termTrans,
|
|
|
764 'abcdefghijklmnopqrstuvwxyz ')=$myTerm)]">
|
|
|
765 <xsl:variable name="tempTerm">
|
|
|
766 <xsl:call-template name="url-encode">
|
|
|
767 <xsl:with-param name="str" select="."/>
|
|
|
768 </xsl:call-template>
|
|
|
769 </xsl:variable>
|
|
|
770 <li><a href="{$bookID}.{substring($myTerm,1,1)}.html?term={$tempTerm}"><xsl:value-of
|
|
|
771 select="."/></a></li>
|
|
|
772 </xsl:for-each>
|
|
|
773 </ul>
|
|
|
774 </xsl:if>
|
|
|
775 </xsl:if>
|
|
|
776
|
|
|
777 <h5><a href="/termSearch?q={substring($myTerm,1,2)}&authorID={$authorID}&bookID={$bookID}">More terms</a></h5>
|
|
|
778 <a name="navbottom" id="navbottom"/>
|
|
|
779 <xsl:call-template name="navbar">
|
|
|
780 <xsl:with-param name="prev"
|
|
|
781 select="translate(substring($termNode/preceding::term[1],1,1),
|
|
|
782 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />
|
|
|
783 <xsl:with-param name="prevParam">
|
|
|
784 <xsl:if test="$termNode/preceding::term[1]">?term=<xsl:call-template name="url-encode">
|
|
|
785 <xsl:with-param name="str" select="$termNode/preceding::term[1]" /></xsl:call-template></xsl:if>
|
|
|
786 </xsl:with-param>
|
|
|
787 <xsl:with-param name="next"
|
|
|
788 select="translate(substring($termNode/following::term[1],1,1),
|
|
|
789 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />
|
|
|
790 <xsl:with-param name="nextParam">
|
|
|
791 <xsl:if test="$termNode/following::term[1]">?term=<xsl:call-template name="url-encode">
|
|
|
792 <xsl:with-param name="str" select="$termNode/following::term[1]" /></xsl:call-template></xsl:if>
|
|
|
793 </xsl:with-param>
|
|
|
794 </xsl:call-template>
|
|
|
795 </xsl:template>
|
|
|
796
|
|
|
797
|
|
|
798 <!-- ======================================================= -->
|
|
|
799 <!-- Create a dictionary term page when $myTerm isn't found -->
|
|
|
800 <!-- ======================================================= -->
|
|
|
801 <xsl:template name="dictTermNotFound">
|
|
|
802 <xsl:call-template name="navbar">
|
|
|
803 <xsl:with-param name="prev" select="substring($myTerm,1,1)"/>
|
|
|
804 <xsl:with-param name="prevParam">?start=<xsl:value-of
|
|
|
805 select="substring($myTerm,1,1)"/>
|
|
|
806 </xsl:with-param>
|
|
|
807 <xsl:with-param name="next"
|
|
|
808 select="translate(substring($myTerm,1,1),
|
|
|
809 'abcdefghijklmnopqrstuvwxyz','bcdefghijklmnopqrstuvwxyza')"/>
|
|
|
810 <xsl:with-param name="nextParam">?start=<xsl:value-of
|
|
|
811 select="translate(substring($myTerm,1,1),
|
|
|
812 'abcdefghijklmnopqrstuvwxyz','bcdefghijklmnopqrstuvwxyza')"/>
|
|
|
813 </xsl:with-param>
|
|
|
814 </xsl:call-template>
|
|
|
815
|
|
|
816 <h2 termName="{$myTerm}">Term not found.</h2>
|
|
|
817 <xsl:choose>
|
|
|
818
|
|
|
819 <!-- if myTerm is contained by an existing term... -->
|
|
|
820 <xsl:when test="count(//glossary/term[contains(translate(.,
|
|
|
821 $termTrans,'abcdefghijklmnopqrstuvwxyz '),
|
|
|
822 $myTerm)]) > 0">
|
|
|
823 <h5>What about these terms?</h5>
|
|
|
824 <ul>
|
|
|
825 <xsl:for-each select="//glossary/term[contains(translate(.,
|
|
|
826 $termTrans,'abcdefghijklmnopqrstuvwxyz '),
|
|
|
827 $myTerm)]">
|
|
|
828 <li><a bcbParam="true">
|
|
|
829 <xsl:attribute name="href">
|
|
|
830 <xsl:value-of select="$bookID"/>.<xsl:value-of select="translate(substring(.,1,1),
|
|
|
831 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
|
|
|
832 <xsl:value-of select="$urlSuffix"/>?term=<xsl:call-template name="url-encode">
|
|
|
833 <xsl:with-param name="str" select="."/></xsl:call-template>
|
|
|
834 </xsl:attribute>
|
|
|
835 <xsl:value-of select="."/></a></li>
|
|
|
836 </xsl:for-each>
|
|
|
837 </ul>
|
|
|
838 </xsl:when>
|
|
|
839
|
|
|
840 <!-- if myTerm isn't contained in an existing term, return
|
|
|
841 terms that start with the same two letters -->
|
|
|
842 <xsl:otherwise>
|
|
|
843 <xsl:variable name="beginTerm" select="substring($myTerm,1,2)"/>
|
|
|
844 <xsl:if test="//glossary/term[starts-with(translate(.,
|
|
|
845 $termTrans,'abcdefghijklmnopqrstuvwxyz '),
|
|
|
846 $beginTerm)]">
|
|
|
847 <h5>What about these terms?</h5>
|
|
|
848 <ul>
|
|
|
849 <xsl:for-each select="//glossary/term[starts-with(translate(.,
|
|
|
850 $termTrans,'abcdefghijklmnopqrstuvwxyz '),
|
|
|
851 $beginTerm)]">
|
|
|
852 <xsl:variable name="tempTerm">
|
|
|
853 <xsl:call-template name="url-encode">
|
|
|
854 <xsl:with-param name="str" select="."/>
|
|
|
855 </xsl:call-template>
|
|
|
856 </xsl:variable>
|
|
|
857 <li><a bcbParam="true" href="{$bookID}.{translate(substring(.,1,1),
|
|
|
858 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
|
|
859 'abcdefghijklmnopqrstuvwxyz')}{$urlSuffix}?term={$tempTerm}"><xsl:value-of
|
|
|
860 select="."/></a></li>
|
|
|
861 </xsl:for-each>
|
|
|
862 </ul>
|
|
|
863 </xsl:if>
|
|
|
864 </xsl:otherwise>
|
|
|
865 </xsl:choose>
|
|
|
866 </xsl:template>
|
|
|
867
|
|
|
868
|
|
|
869 <!-- ============================================== -->
|
|
|
870 <!-- Gnarly template to generate the about page -->
|
|
|
871 <!-- ============================================== -->
|
|
|
872 <xsl:template match="ThML.head" name="about" mode="includeParsing">
|
|
|
873
|
|
|
874 <p><a name="about"> </a></p>
|
|
|
875 <center>
|
|
|
876 <table border="2" bordercolor="#660000" style="margin-top:12pt; width: 440pt" >
|
|
|
877 <tr>
|
|
|
878 <td bgcolor="#660000" width="100%" colspan="3"><p class="whitehead" style="text-align:center; font-size:14pt">About
|
|
|
879 <i><xsl:value-of select="$title"/></i> by <xsl:value-of select="$author"/></p>
|
|
|
880 </td>
|
|
|
881 </tr>
|
|
|
882 <tr><td colspan="3">
|
|
|
883 <center>
|
|
|
884 <p style="text-align:center; margin-top:12pt">
|
|
|
885 <form method="get" action="http://www.ccel.org/search">
|
|
|
886 <span style="font-weight:bold; font-size:14pt"><a bcbParam="true" class="TOC" href="{$titlepageURL}">Title Page</a></span>
|
|
|
887      
|
|
|
888 <span style="font-weight:bold; font-size:14pt"><a bcbParam="true" class="TOC" href="{$tocURL}">Table of Contents</a></span>
|
|
|
889      
|
|
|
890 <xsl:if test="$isDaily=1">
|
|
|
891 <span style="font-weight:bold; font-size:14pt"><a class="TOC"
|
|
|
892 href="javascript:goToday()">Today's Reading</a></span>
|
|
|
893 </xsl:if>
|
|
|
894      
|
|
|
895
|
|
|
896 <input type="hidden" name="a" value="advanced_search" />
|
|
|
897 <input type="hidden" name="authorID" value="{$authorID}" />
|
|
|
898 <input type="hidden" name="bookID" value="{$bookID}" />
|
|
|
899 <span style="font-weight:bold; font-size:16pt">Search:</span> 
|
|
|
900 <input type="text" size="12" name="q" value="" />
|
|
|
901 <input type="Submit" value="Go" />
|
|
|
902 </form>
|
|
|
903 </p>
|
|
|
904 </center>
|
|
|
905 </td></tr>
|
|
|
906 <tr><td ><table>
|
|
|
907 <tr>
|
|
|
908 <td style="width:110pt; text-align:right;">
|
|
|
909 <p style="margin-top:12pt"><b>Title:</b></p></td>
|
|
|
910 <td style="width:5pt"></td>
|
|
|
911 <td width="*">
|
|
|
912 <p style="margin-top:12pt">
|
|
|
913 <a class="TOC" bcbParam="true" href="{$titlepageURL}">
|
|
|
914 <xsl:value-of select="$title"/></a></p></td>
|
|
|
915 </tr>
|
|
|
916
|
|
|
917 <tr>
|
|
|
918 <td align="right" valign="top"><b>Creator(s):</b></td>
|
|
|
919 <td></td>
|
|
|
920 <td><a class="TOC">
|
|
|
921 <xsl:attribute name="href">
|
|
|
922 <xsl:choose>
|
|
|
923 <xsl:when test="$desktop=1">/ccel/<xsl:value-of
|
|
|
924 select="$authorID"/>.html</xsl:when>
|
|
|
925 <xsl:otherwise>/<xsl:value-of select="$authLet"/>/<xsl:value-of
|
|
|
926 select="$authorID"/></xsl:otherwise>
|
|
|
927 </xsl:choose>
|
|
|
928 </xsl:attribute>
|
|
|
929 <xsl:value-of select="electronicEdInfo/DC/DC.Creator[@sub='Author' and @scheme='file-as']"/></a>
|
|
|
930 <xsl:for-each select="electronicEdInfo/DC/DC.Creator[@sub!='Author' and @scheme='file-as']">
|
|
|
931 <br/><xsl:value-of select="."/><xsl:if test="@sub != ''"> (<xsl:value-of select="@sub"/>)</xsl:if>
|
|
|
932 </xsl:for-each>
|
|
|
933 </td>
|
|
|
934 </tr>
|
|
|
935
|
|
|
936 <xsl:if test="electronicEdInfo/DC/DC.Publisher!=''">
|
|
|
937 <tr><td align="right" valign="top"><b>Publisher:</b></td><td></td><td><xsl:value-of
|
|
|
938 select="electronicEdInfo/DC/DC.Publisher"/></td></tr>
|
|
|
939 </xsl:if>
|
|
|
940
|
|
|
941 <xsl:if test="generalInfo/description != ''">
|
|
|
942 <tr><td align="right" valign="top"><b>Description:</b></td><td></td><td><xsl:apply-templates
|
|
|
943 select="generalInfo/description" mode="includeParsing"/></td></tr>
|
|
|
944 </xsl:if>
|
|
|
945
|
|
|
946 <xsl:if test="generalInfo/firstPublished != ''">
|
|
|
947 <tr><td align="right" valign="top"><b>First Published:</b></td><td></td><td><xsl:apply-templates
|
|
|
948 select="generalInfo/firstPublished" mode="includeParsing"/></td></tr>
|
|
|
949 </xsl:if>
|
|
|
950
|
|
|
951 <xsl:if test="generalInfo/pubHistory != ''">
|
|
|
952 <tr><td align="right" valign="top"><b>Publication History:</b></td><td></td><td><xsl:apply-templates
|
|
|
953 select="generalInfo/pubHistory" mode="includeParsing"/></td></tr>
|
|
|
954 </xsl:if>
|
|
|
955
|
|
|
956 <xsl:if test="printSourceInfo/published != ''">
|
|
|
957 <tr><td align="right" valign="top"><b>Print Basis:</b></td><td></td><td><xsl:apply-templates
|
|
|
958 select="printSourceInfo/published" mode="includeParsing"/></td></tr>
|
|
|
959 </xsl:if>
|
|
|
960
|
|
|
961 <xsl:if test="electronicEdInfo/DC/DC.Source[not(@scheme)] != ''">
|
|
|
962 <tr><td align="right" valign="top"><b>Source:</b></td><td></td><td>
|
|
|
963 <xsl:choose>
|
|
|
964 <xsl:when test="electronicEdInfo/DC/DC.Source[@scheme = 'URL'] != ''">
|
|
|
965 <a class="TOC" href="{electronicEdInfo/DC/DC.Source[@scheme = 'URL']}"><xsl:value-of
|
|
|
966 select="electronicEdInfo/DC/DC.Source[not(@scheme)]"/></a>
|
|
|
967 </xsl:when>
|
|
|
968 <xsl:otherwise>
|
|
|
969 <xsl:value-of select="electronicEdInfo/DC/DC.Source[not(@scheme)]"/>
|
|
|
970 </xsl:otherwise>
|
|
|
971 </xsl:choose>
|
|
|
972 </td></tr>
|
|
|
973 </xsl:if>
|
|
|
974
|
|
|
975 <xsl:variable name="lang" select="electronicEdInfo/DC/DC.Language"/>
|
|
|
976 <xsl:if test="$lang != '' and not(starts-with($lang, 'en'))">
|
|
|
977 <tr><td align="right" valign="top"><b>Language:</b></td><td></td><td>
|
|
|
978 <xsl:value-of select="document('')/*/lang:name[@code=$lang]"/></td></tr>
|
|
|
979 </xsl:if>
|
|
|
980
|
|
|
981 <xsl:if test="electronicEdInfo/series != ''">
|
|
|
982 <tr>
|
|
|
983 <td align="right" valign="top"><b>Series:</b></td><td></td>
|
|
|
984 <td><xsl:value-of select="electronicEdInfo/series"/>
|
|
|
985 </td></tr>
|
|
|
986 </xsl:if>
|
|
|
987
|
|
|
988 <xsl:if test="electronicEdInfo/DC/DC.Rights != ''">
|
|
|
989 <tr><td align="right" valign="top"><b>Rights:</b></td><td></td><td><xsl:value-of
|
|
|
990 select="electronicEdInfo/DC/DC.Rights"/></td></tr>
|
|
|
991 </xsl:if>
|
|
|
992
|
|
|
993 <xsl:if test="electronicEdInfo/DC/DC.Date[@sub = 'Created'] != ''">
|
|
|
994 <tr><td align="right" valign="top"><b>Date Created:</b></td><td></td><td><xsl:value-of
|
|
|
995 select="electronicEdInfo/DC/DC.Date[@sub = 'Created']"/></td></tr>
|
|
|
996 </xsl:if>
|
|
|
997
|
|
|
998 <xsl:if test="electronicEdInfo/status != ''">
|
|
|
999 <tr><td align="right" valign="top"><b>Status:</b></td><td></td><td><xsl:apply-templates
|
|
|
1000 select="electronicEdInfo/status" mode="includeParsing"/></td></tr>
|
|
|
1001 </xsl:if>
|
|
|
1002
|
|
|
1003 <xsl:if test="generalInfo/comments != ''">
|
|
|
1004 <tr><td align="right" valign="top"><b>Comments:</b></td><td></td><td><xsl:apply-templates
|
|
|
1005 select="generalInfo/comments" mode="includeParsing"/></td></tr>
|
|
|
1006 </xsl:if>
|
|
|
1007
|
|
|
1008 <xsl:if test="electronicEdInfo/editorialComments != ''">
|
|
|
1009 <tr><td align="right" valign="top"><b>Editorial Comments:</b></td><td></td><td><xsl:apply-templates
|
|
|
1010 select="electronicEdInfo/editorialComments" mode="includeParsing"/></td></tr>
|
|
|
1011 </xsl:if>
|
|
|
1012
|
|
|
1013 <xsl:if test="electronicEdInfo/DC/DC.Contributor != ''">
|
|
|
1014 <tr><td align="right" valign="top"><b>Contributor(s):</b></td><td></td><td>
|
|
|
1015 <xsl:for-each select="electronicEdInfo/DC/DC.Contributor">
|
|
|
1016 <xsl:if test=". != ''">
|
|
|
1017 <xsl:value-of select="."/> (<xsl:value-of select="@sub"/>)<br/>
|
|
|
1018 </xsl:if>
|
|
|
1019 </xsl:for-each></td>
|
|
|
1020 </tr>
|
|
|
1021 </xsl:if>
|
|
|
1022
|
|
|
1023 <xsl:if test="electronicEdInfo/DC/DC.Subject[@scheme = 'ccel'] != ''">
|
|
|
1024 <tr><td align="right" valign="top"><b>CCEL Subjects:</b></td><td></td><td><xsl:value-of
|
|
|
1025 select="electronicEdInfo/DC/DC.Subject[@scheme = 'ccel']"/></td>
|
|
|
1026 </tr>
|
|
|
1027 </xsl:if>
|
|
|
1028
|
|
|
1029 <xsl:if test="electronicEdInfo/DC/DC.Subject[@scheme = 'LCCN'] != ''">
|
|
|
1030 <tr><td align="right" valign="top"><b>LC Call no:</b></td><td></td><td><xsl:variable name="lccn"
|
|
|
1031 select="electronicEdInfo/DC/DC.Subject[@scheme = 'LCCN']"/><xsl:value-of
|
|
|
1032 select="electronicEdInfo/DC/DC.Subject[@scheme='LCCN']"/></td>
|
|
|
1033 </tr>
|
|
|
1034 </xsl:if>
|
|
|
1035
|
|
|
1036 <xsl:if test="electronicEdInfo/DC/DC.Subject[starts-with(@scheme, 'lcsh')] != ''">
|
|
|
1037 <tr><td align="right" valign="top"><b>LC Subjects:</b></td><td></td><td>
|
|
|
1038 <xsl:for-each select="electronicEdInfo/DC/DC.Subject[starts-with(@scheme, 'lcsh')]">
|
|
|
1039 <xsl:variable name="class" select="concat('t', substring-after(@scheme, 'lcsh'))"/>
|
|
|
1040 <p class="{$class}"><xsl:value-of select="."/></p>
|
|
|
1041 </xsl:for-each></td>
|
|
|
1042 </tr>
|
|
|
1043 </xsl:if>
|
|
|
1044
|
|
|
1045 <xsl:if test="contains($ccsubj,'Shell')=false">
|
|
|
1046 <tr><td align="right" valign="top">
|
|
|
1047 <p style="margin-bottom:12pt"><b><a class="TOC"
|
|
|
1048 href="http://www.ccel.org/help/formats.html">Other Formats:</a></b></p></td>
|
|
|
1049 <td></td><td>
|
|
|
1050 <p style="margin-bottom:12pt">
|
|
|
1051 <a class="TOC" href="/{$authLet}/{$authorID}/{$bookID}.xml">ThML</a>
|
|
|
1052 - <a class="TOC" href="/ccel/{$authorID}/{$bookID}.pdf">pdf</a>
|
|
|
1053 - <a class="TOC" href="/ccel/{$authorID}/{$bookID}.pdb">pdb</a>
|
|
|
1054 - <a class="TOC" href="/ccel/{$authorID}/{$bookID}.htm">htm</a>
|
|
|
1055 - <a class="TOC" href="/ccel/{$authorID}/{$bookID}.txt">txt</a>
|
|
|
1056 - <a class="TOC" href="/ccel/{$authorID}/{$bookID}.fo">fo</a>
|
|
|
1057 <xsl:if test="not($desktop=1)">
|
|
|
1058
|
|
|
1059 <xsl:for-each select="document($bookInfo)/bookInfo/format">
|
|
|
1060 <xsl:text> - </xsl:text><a class="TOC" href="{.}"><xsl:value-of
|
|
|
1061 select="@type"/></a>
|
|
|
1062 </xsl:for-each>
|
|
|
1063 </xsl:if>
|
|
|
1064 </p>
|
|
|
1065 </td>
|
|
|
1066 </tr>
|
|
|
1067 </xsl:if>
|
|
|
1068 </table>
|
|
|
1069 <table style="width:100%">
|
|
|
1070 <tr><td bgcolor="#660000" width="100%" colspan="3">
|
|
|
1071 <p class="whitehead" style="text-align:center;font-size:14pt">
|
|
|
1072 Other ways to get <i><xsl:value-of select="$title"/></i></p></td></tr>
|
|
|
1073 <tr><td colspan="3">
|
|
|
1074 <xsl:copy-of select="document($bookInfo)/bookInfo/offer/*"/>
|
|
|
1075
|
|
|
1076 <p style="margin-top:12pt; margin-left:10%">
|
|
|
1077 <a href="http://www.christianbook.com/Christian/Books/easy_find?event=AFF&p=1026055&Ns=product.number_sold&Nso=1&Ntk=typeset.typeset&Ntt={$authorID}%20{$bookID}&Nu=product.endeca_rollup">
|
|
|
1078 Search for this book at ChristianBooks.com</a>
|
|
|
1079 </p>
|
|
|
1080
|
|
|
1081 </td></tr>
|
|
|
1082 </table>
|
|
|
1083 </td></tr>
|
|
|
1084 </table>
|
|
|
1085 </center>
|
|
|
1086 </xsl:template>
|
|
|
1087
|
|
|
1088
|
|
|
1089 <!-- =========================================== -->
|
|
|
1090 <!-- standard navbar, with doc and section title -->
|
|
|
1091 <!-- =========================================== -->
|
|
|
1092 <xsl:template name="navbar">
|
|
|
1093 <xsl:param name="prev"/>
|
|
|
1094 <xsl:param name="next"/>
|
|
|
1095 <xsl:param name="prevParam"></xsl:param>
|
|
|
1096 <xsl:param name="nextParam"></xsl:param>
|
|
|
1097 <!-- prev and next should be attributes with the ID of the previous and next
|
|
|
1098 section. If they aren't there we can compute them, but that takes time. -->
|
|
|
1099 <xsl:variable name="myPrev">
|
|
|
1100 <xsl:value-of select="$urlPrefix"/>
|
|
|
1101 <xsl:choose>
|
|
|
1102 <xsl:when test="@prev"><xsl:value-of select="@prev"/></xsl:when>
|
|
|
1103 <xsl:when test="$prev=''">toc</xsl:when>
|
|
|
1104 <xsl:when test="$prev"><xsl:value-of select="translate($prev,' ;,','+')"/></xsl:when>
|
|
|
1105 <xsl:otherwise><xsl:value-of select="preceding-sibling::div1[1]/div2[last()]/div3[last()]/div4[last()]/@id|preceding-sibling::div1[1]/div2[last()]/div3[last()]/@id|preceding-sibling::div2[1]/div3[last()]/div4[last()]/@id|preceding-sibling::div3[1]/div4[last()]/div5[last()]/@id|preceding-sibling::div1[1]/div2[last()]/@id|preceding-sibling::div2[1]/div3[last()]/@id|preceding-sibling::div3[1]/div4[last()]/@id|preceding-sibling::div4[1]/div5[last()]/@id|preceding-sibling::div1[1]/@id|preceding-sibling::div2[1]/@id|preceding-sibling::div3[1]/@id|preceding-sibling::div4[1]/@id|preceding-sibling::div5[1]/@id|ancestor::*/@id"/></xsl:otherwise>
|
|
|
1106 </xsl:choose>
|
|
|
1107 <xsl:value-of select="$urlSuffix"/>
|
|
|
1108 <!--<xsl:value-of select="translate($prevParam,'?','&')"/>-->
|
|
|
1109 <xsl:value-of select="$prevParam"/>
|
|
|
1110 </xsl:variable>
|
|
|
1111 <xsl:variable name="myNext">
|
|
|
1112 <xsl:value-of select="$urlPrefix"/>
|
|
|
1113 <xsl:choose>
|
|
|
1114 <xsl:when test="@next"><xsl:value-of select="@next"/></xsl:when>
|
|
|
1115 <xsl:when test="$next=''">toc</xsl:when>
|
|
|
1116 <xsl:when test="$next"><xsl:value-of select="translate($next,' ;,','+')"/></xsl:when>
|
|
|
1117 <xsl:otherwise><xsl:value-of select="div1/@id|div2/@id|div3/@id|div4/@id|div5/@id|following-sibling::*/@id|../following-sibling::*/@id|../../following-sibling::*/@id|../../../following-sibling::*/@id|../../../../following-sibling::*/@id"/></xsl:otherwise>
|
|
|
1118 </xsl:choose>
|
|
|
1119 <xsl:value-of select="$urlSuffix"/>
|
|
|
1120 <!--<xsl:value-of select="translate($nextParam,'?','&')"/>-->
|
|
|
1121 <xsl:value-of select="$nextParam"/>
|
|
|
1122 </xsl:variable>
|
|
|
1123
|
|
|
1124 <xsl:if test="$debug">
|
|
|
1125 <xsl:message>myPrev: <xsl:value-of select="$myPrev"/></xsl:message>
|
|
|
1126 <xsl:message>myNext: <xsl:value-of select="$myNext"/></xsl:message>
|
|
|
1127 </xsl:if>
|
|
|
1128
|
|
|
1129 <p id="bcbHide"><a><xsl:attribute name="name"><xsl:value-of select="@id"/></xsl:attribute> </a></p>
|
|
|
1130 <table id="bcbHide" width="100%" bgcolor="#660000">
|
|
|
1131 <tr>
|
|
|
1132 <td valign="top" class="whitehead" style="text-align:left;
|
|
|
1133 font-size:77%; width:37%"><div style="height:12pt; overflow:hidden">
|
|
|
1134 <a style="color:#FFFFFF; text-decoration:none" href="{$urlPrefix}html">
|
|
|
1135 <xsl:value-of select="$headtitle"/></a></div></td>
|
|
|
1136 <td valign="top" class="whitehead" style="text-align:center">
|
|
|
1137 <a bcbParam="true" href="{$myPrev}">
|
|
|
1138 <!--<img onmouseover="this.style.borderColor='#CC6666'" onmouseout="this.style.borderColor='#660000'" src="/pix/mroonppv.gif" alt="Previous" title="Previous" style="border-color:#660000" border="2"/>-->
|
|
|
1139 <img border="0" src="/pix/mroonppv.gif" alt="Previous"/>
|
|
|
1140 </a>
|
|
|
1141 <a bcbParam="true" href="{$tocURL}">
|
|
|
1142 <!--<img onmouseover="this.style.borderColor='#CC6666'" onmouseout="this.style.borderColor='#660000'" src="/pix/mroontoc.gif" alt="Table of Contents" title="Contents" style="border-color:#660000" border="2"/>-->
|
|
|
1143 <img border="0" src="/pix/mroontoc.gif" alt="Contents"/>
|
|
|
1144 </a>
|
|
|
1145 <a bcbParam="true" href="{$myNext}">
|
|
|
1146 <!--<img onmouseover="this.style.borderColor='#CC6666'" onmouseout="this.style.borderColor='#660000'" src="/pix/mroonpnx.gif" alt="Next" title="Next" style="border-color:#660000" border="2"/>-->
|
|
|
1147 <img border="0" src="/pix/mroonpnx.gif" alt="Next"/>
|
|
|
1148 </a>
|
|
|
1149 </td>
|
|
|
1150 <td valign="top" class="whitehead" style="text-align:right;
|
|
|
1151 font-size:77%; width:37%"><div style="height:12pt; overflow:hidden">
|
|
|
1152 <xsl:value-of select="@title"/>
|
|
|
1153 </div></td>
|
|
|
1154 </tr>
|
|
|
1155 <tr><td colspan="3">
|
|
|
1156 <img src="/pix/yellowdot.gif" height="1" >
|
|
|
1157 <xsl:attribute name="width"><xsl:value-of select="@progress"/></xsl:attribute>
|
|
|
1158 </img>
|
|
|
1159 </td></tr>
|
|
|
1160 </table>
|
|
|
1161 <p id="bcbHide"> </p>
|
|
|
1162
|
|
|
1163 <a bcbParam="true" name="prevNav" href="{$myPrev}"/>
|
|
|
1164 <a bcbParam="true" name="nextNav" href="{$myNext}"/>
|
|
|
1165 </xsl:template>
|
|
|
1166
|
|
|
1167
|
|
|
1168 <!-- =============================================== -->
|
|
|
1169 <!-- add the standard CCEL footer (for dynamic docs) -->
|
|
|
1170 <!-- =============================================== -->
|
|
|
1171 <xsl:template name="add-footer">
|
|
|
1172 <table id="bcbHide" align="center" style="clear:right; margin-top:0in">
|
|
|
1173 <tr>
|
|
|
1174 <td>
|
|
|
1175 <a href="http://www.ccel.org">
|
|
|
1176 <img src="/pix/gem-icon2.gif" border="0" alt="CCEL home page"/>
|
|
|
1177 </a>
|
|
|
1178 </td>
|
|
|
1179 <td align="center"><span style="font-size:9pt; font-style:italic">
|
|
|
1180 <xsl:choose>
|
|
|
1181
|
|
|
1182 <!-- running on CCEL desktop -->
|
|
|
1183 <xsl:when test="$desktop=1">
|
|
|
1184 This <a class="TOC" href="http://www.ccel.org/ThML">ThML</a>
|
|
|
1185 document is from the
|
|
|
1186 <a class="TOC" href="http://www.ccel.org">Christian
|
|
|
1187 Classics Ethereal Library</a> at <a class="TOC"
|
|
|
1188 href="http://www.calvin.edu">Calvin College</a>.<br/>
|
|
|
1189
|
|
|
1190 <a class="TOC" href="/index.jsp">Home</a> |
|
|
|
1191 <a class="TOC" href="/jsp/prefs.jsp">Preferences</a>
|
|
|
1192 <!--<xsl:if test="$cd!=1">-->
|
|
|
1193 | Search this book: <form style="margin-top:0in"
|
|
|
1194 action="/search" method="get">
|
|
|
1195 <input type="hidden" name="authorID" value="{$authorID}" />
|
|
|
1196 <input type="hidden" name="bookID" value="{$bookID}" />
|
|
|
1197 <input type="hidden" name="a" value="search" />
|
|
|
1198 <input type="text" name="q" size="12"
|
|
|
1199 style="font-size:8pt"/>
|
|
|
1200 <input type="submit" value="Go" size="7"/>
|
|
|
1201 </form>
|
|
|
1202 <!--</xsl:if>-->
|
|
|
1203 </xsl:when>
|
|
|
1204
|
|
|
1205 <!-- create HTML files on server -->
|
|
|
1206 <xsl:otherwise>
|
|
|
1207 This document is from the <a class="TOC"
|
|
|
1208 href="http://www.ccel.org">Christian Classics
|
|
|
1209 Ethereal Library</a> at <a class="TOC"
|
|
|
1210 href="http://www.calvin.edu">Calvin College</a>,<br/>
|
|
|
1211 generated on demand from
|
|
|
1212 <a class="TOC" href="http://www.ccel.org/ThML">ThML </a>
|
|
|
1213 <a class="TOC"
|
|
|
1214 href="http://www.ccel.org/ccel/{$authorID}/{$bookID}.xml">source</a>
|
|
|
1215 at <script type="text/javascript">document.write(
|
|
|
1216 document.lastModified);</script>. <br/>
|
|
|
1217 <xsl:variable name="hitfile" select="concat('/ccel/',$authLet,'/',
|
|
|
1218 $authorID, '/', $bookID, '/hits.xml')"/>
|
|
|
1219 This book has been accessed more than
|
|
|
1220 <xsl:value-of select="document($hitfile)/stats/hits"/> times
|
|
|
1221 since
|
|
|
1222 <xsl:value-of select="document($hitfile)/stats/date"/>.
|
|
|
1223 </xsl:otherwise>
|
|
|
1224 </xsl:choose>
|
|
|
1225 </span></td>
|
|
|
1226
|
|
|
1227 <td>
|
|
|
1228 <a class="TOC" href="http://www.calvin.edu">
|
|
|
1229 <img src="/pix/seal.gif" border="0" alt="Calvin seal: My heart I offer you O Lord, promptly and sincerely"/>
|
|
|
1230 </a>
|
|
|
1231 </td>
|
|
|
1232 </tr>
|
|
|
1233 </table>
|
|
|
1234 </xsl:template>
|
|
|
1235
|
|
|
1236
|
|
|
1237 <!-- ========================== -->
|
|
|
1238 <!-- process ThML body elements -->
|
|
|
1239 <!-- ========================== -->
|
|
|
1240
|
|
|
1241 <!-- include included stuff -->
|
|
|
1242 <xsl:template match="xi:include" mode="includeParsing">
|
|
|
1243 <xsl:if test="$debug">
|
|
|
1244 <xsl:message>xi:include: loading <xsl:value-of select="@href"/></xsl:message>
|
|
|
1245 </xsl:if>
|
|
|
1246
|
|
|
1247 <xsl:apply-templates select="document(@href,$rootPath)" mode="includeParsing"/>
|
|
|
1248 </xsl:template>
|
|
|
1249
|
|
|
1250 <xsl:template match="scripCom" mode="includeParsing">
|
|
|
1251 <a name="{@id}" />
|
|
|
1252 </xsl:template>
|
|
|
1253
|
|
|
1254 <!-- just drop the tags -->
|
|
|
1255 <xsl:template match="scripContext|insertIndex|added" mode="includeParsing">
|
|
|
1256 <a id="{@id}" />
|
|
|
1257 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1258 </xsl:template>
|
|
|
1259
|
|
|
1260 <!-- convert <elt class="xxx"> to <span class="elt"><span class="xxx"> -->
|
|
|
1261 <xsl:template match="date|foreign|index|name|unclear"
|
|
|
1262 mode="includeParsing">
|
|
|
1263 <span class="{local-name()}">
|
|
|
1264 <xsl:copy-of select="@*[name() != 'class']"/>
|
|
|
1265 <xsl:choose>
|
|
|
1266 <xsl:when test="@class != ''">
|
|
|
1267 <span class="{@class}">
|
|
|
1268 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1269 </span>
|
|
|
1270 </xsl:when>
|
|
|
1271 <xsl:otherwise>
|
|
|
1272 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1273 </xsl:otherwise>
|
|
|
1274 </xsl:choose>
|
|
|
1275 </span>
|
|
|
1276 </xsl:template>
|
|
|
1277
|
|
|
1278 <xsl:template match="scripture"
|
|
|
1279 mode="includeParsing">
|
|
|
1280 <span class="{local-name()}">
|
|
|
1281 <xsl:choose>
|
|
|
1282 <xsl:when test="@*[name() = 'id']">
|
|
|
1283 <xsl:copy-of select="@*[name() != 'class']"/>
|
|
|
1284 </xsl:when>
|
|
|
1285 <xsl:when test="@*[name() = 'osisRef']">
|
|
|
1286 <xsl:attribute name="id">
|
|
|
1287 <xsl:variable name="bk1"><xsl:value-of select="substring-after(@*[name() = 'osisRef'],':')"/></xsl:variable>
|
|
|
1288 <xsl:choose>
|
|
|
1289 <xsl:when test="starts-with($bk1,'1')"><xsl:value-of select="concat('i',substring-after($bk1,'1'))"/></xsl:when>
|
|
|
1290 <xsl:when test="starts-with($bk1,'2')"><xsl:value-of select="concat('ii',substring-after($bk1,'2'))"/></xsl:when>
|
|
|
1291 <xsl:when test="starts-with($bk1,'3')"><xsl:value-of select="concat('iii',substring-after($bk1,'3'))"/></xsl:when>
|
|
|
1292 <xsl:otherwise><xsl:value-of select="$bk1"/></xsl:otherwise>
|
|
|
1293 </xsl:choose>
|
|
|
1294 </xsl:attribute>
|
|
|
1295 <xsl:copy-of select="@*[name() != 'class']"/>
|
|
|
1296 </xsl:when>
|
|
|
1297 <xsl:otherwise>
|
|
|
1298 <xsl:message>Warning: no scripture id found (nor equivalent osisRef) - verse won't be highlighted</xsl:message>
|
|
|
1299 <xsl:copy-of select="@*[name() != 'class']"/>
|
|
|
1300 </xsl:otherwise>
|
|
|
1301 </xsl:choose>
|
|
|
1302 <xsl:choose>
|
|
|
1303 <xsl:when test="@class != ''">
|
|
|
1304 <span class="{@class}">
|
|
|
1305 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1306 </span>
|
|
|
1307 </xsl:when>
|
|
|
1308 <xsl:otherwise>
|
|
|
1309 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1310 </xsl:otherwise>
|
|
|
1311
|
|
|
1312 </xsl:choose>
|
|
|
1313 </span>
|
|
|
1314 </xsl:template>
|
|
|
1315
|
|
|
1316 <!-- convert <elt class="xxx"> to <div class="elt"><p class="xxx"> -->
|
|
|
1317 <xsl:template match="argument|attr|author|composer|incipit|l|meter|music|tune" mode="includeParsing">
|
|
|
1318 <xsl:choose>
|
|
|
1319 <xsl:when test="@class != ''">
|
|
|
1320 <div class="{local-name()}">
|
|
|
1321 <p class="{@class}">
|
|
|
1322 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1323 </p>
|
|
|
1324 </div>
|
|
|
1325 </xsl:when>
|
|
|
1326 <xsl:otherwise>
|
|
|
1327 <p class="{local-name()}">
|
|
|
1328 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1329 </p>
|
|
|
1330 </xsl:otherwise>
|
|
|
1331 </xsl:choose>
|
|
|
1332 </xsl:template>
|
|
|
1333
|
|
|
1334 <!-- hymn: do non-verse stuff, then put <verse>s in a centered td -->
|
|
|
1335 <xsl:template match="hymn" mode="includeParsing">
|
|
|
1336 <div class="hymn" id="{@id}">
|
|
|
1337 <xsl:apply-templates mode="includeParsing" select="*[name()!='verse']"/>
|
|
|
1338 <div class="Center">
|
|
|
1339 <table><tr><td>
|
|
|
1340 <xsl:apply-templates mode="includeParsing" select="verse"/>
|
|
|
1341 </td></tr></table>
|
|
|
1342 </div>
|
|
|
1343 </div>
|
|
|
1344 </xsl:template>
|
|
|
1345
|
|
|
1346 <!-- glossary, term, def -->
|
|
|
1347 <xsl:template match="glossary" mode="includeParsing">
|
|
|
1348 <dl>
|
|
|
1349 <xsl:copy-of select="@*"/>
|
|
|
1350 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1351 </dl>
|
|
|
1352 </xsl:template>
|
|
|
1353
|
|
|
1354 <xsl:template match="term" mode="includeParsing">
|
|
|
1355 <dt>
|
|
|
1356 <xsl:copy-of select="@*"/>
|
|
|
1357 <xsl:choose>
|
|
|
1358 <xsl:when test="following-sibling::def[@source]">
|
|
|
1359 <a href="{following-sibling::def/@target}">
|
|
|
1360 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1361 </a>
|
|
|
1362 <!--<xsl:text> - from </xsl:text>
|
|
|
1363 <a href="{following-sibling::def/@surl}">
|
|
|
1364 <xsl:value-of select="following-sibling::def/@source"/>
|
|
|
1365 </a>-->
|
|
|
1366 </xsl:when>
|
|
|
1367 <xsl:otherwise>
|
|
|
1368 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1369 </xsl:otherwise>
|
|
|
1370 </xsl:choose>
|
|
|
1371 </dt>
|
|
|
1372 </xsl:template>
|
|
|
1373
|
|
|
1374 <xsl:template match="def" mode="includeParsing">
|
|
|
1375 <xsl:if test="not(@source)">
|
|
|
1376 <dd>
|
|
|
1377 <xsl:copy-of select="@*"/>
|
|
|
1378 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1379 </dd>
|
|
|
1380 </xsl:if>
|
|
|
1381 </xsl:template>
|
|
|
1382
|
|
|
1383 <!-- sync -->
|
|
|
1384 <xsl:template match="sync" mode="includeParsing">
|
|
|
1385 <a>
|
|
|
1386 <xsl:attribute name="name"><xsl:value-of select="@type"/>_<xsl:value-of select="@value"/></xsl:attribute>
|
|
|
1387 </a>
|
|
|
1388 </xsl:template>
|
|
|
1389
|
|
|
1390 <!-- <pb> -->
|
|
|
1391 <xsl:template match="pb" mode="includeParsing">
|
|
|
1392 <span>
|
|
|
1393 <xsl:attribute name="class">pb</xsl:attribute>
|
|
|
1394 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
|
|
1395 <xsl:choose>
|
|
|
1396 <xsl:when test="@href">
|
|
|
1397 <a class="page">
|
|
|
1398 <xsl:attribute name="href">
|
|
|
1399 <xsl:value-of select="@href"/>
|
|
|
1400 </xsl:attribute>
|
|
|
1401 <xsl:value-of select="@n"/>
|
|
|
1402 </a>
|
|
|
1403 </xsl:when>
|
|
|
1404 <xsl:otherwise>
|
|
|
1405 <xsl:value-of select="@n"/>
|
|
|
1406 </xsl:otherwise>
|
|
|
1407 </xsl:choose>
|
|
|
1408 </span>
|
|
|
1409 </xsl:template>
|
|
|
1410
|
|
|
1411
|
|
|
1412 <!-- delete deleted stuff -->
|
|
|
1413 <xsl:template match="deleted" mode="includeParsing">
|
|
|
1414 </xsl:template>
|
|
|
1415
|
|
|
1416
|
|
|
1417 <!-- verse: put in a centered table -->
|
|
|
1418 <xsl:template match="verse" mode="includeParsing">
|
|
|
1419 <div class="verse2">
|
|
|
1420 <table><tr><td>
|
|
|
1421 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1422 </td></tr></table>
|
|
|
1423 </div>
|
|
|
1424 </xsl:template>
|
|
|
1425
|
|
|
1426
|
|
|
1427 <!-- scripref: link to /ccel/bible reference -->
|
|
|
1428 <xsl:template match="scripRef" mode="includeParsing">
|
|
|
1429
|
|
|
1430 <!-- parse osisRef to get bk, ch -->
|
|
|
1431 <xsl:variable name="psg"><xsl:value-of
|
|
|
1432 select="substring-before(concat(
|
|
|
1433 substring-after(@osisRef,':'),'-'),'-')"/></xsl:variable>
|
|
|
1434 <xsl:variable name="bk1"><xsl:value-of
|
|
|
1435 select="substring-before($psg,'.')"/></xsl:variable>
|
|
|
1436 <xsl:variable name="bk">
|
|
|
1437 <xsl:choose>
|
|
|
1438 <xsl:when test="starts-with($bk1,'1')"><xsl:value-of select="concat('i',substring-after($bk1,'1'))"/></xsl:when>
|
|
|
1439 <xsl:when test="starts-with($bk1,'2')"><xsl:value-of select="concat('ii',substring-after($bk1,'2'))"/></xsl:when>
|
|
|
1440 <xsl:when test="starts-with($bk1,'3')"><xsl:value-of select="concat('iii',substring-after($bk1,'3'))"/></xsl:when>
|
|
|
1441 <xsl:otherwise><xsl:value-of select="$bk1"/></xsl:otherwise>
|
|
|
1442 </xsl:choose>
|
|
|
1443 </xsl:variable>
|
|
|
1444 <xsl:variable name="ch"><xsl:if
|
|
|
1445 test="substring-before(substring-after($psg,'.'),'.') != ''"><xsl:value-of
|
|
|
1446 select="substring-before(substring-after($psg,'.'),'.')"/></xsl:if><xsl:if
|
|
|
1447 test="substring-before(substring-after($psg,'.'),'.') = ''"><xsl:value-of
|
|
|
1448 select="substring-after($psg,'.')"/></xsl:if></xsl:variable>
|
|
|
1449 <xsl:variable name="v"><xsl:value-of
|
|
|
1450 select="substring-after($psg,concat($bk1,'.',$ch,'.'))"/></xsl:variable>
|
|
|
1451 <xsl:variable name="vdot"><xsl:if test="$v != ''">.<xsl:value-of
|
|
|
1452 select="$v"/></xsl:if></xsl:variable>
|
|
|
1453
|
|
|
1454 <xsl:variable name="pref">
|
|
|
1455 <xsl:value-of select="document('bible.xml')/books/grouping[book[osisID[text()=$bk1]]]/@pref"/>
|
|
|
1456 </xsl:variable>
|
|
|
1457 <xsl:variable name="bibleID">
|
|
|
1458 <xsl:choose>
|
|
|
1459 <xsl:when test="$pref = 'ot_bib'"><xsl:value-of select="$ot_bib"/></xsl:when>
|
|
|
1460 <xsl:when test="$pref = 'nt_bib'"><xsl:value-of select="$nt_bib"/></xsl:when>
|
|
|
1461 <xsl:otherwise><xsl:value-of select="$ap_bib"/></xsl:otherwise>
|
|
|
1462 </xsl:choose>
|
|
|
1463 </xsl:variable>
|
|
|
1464 <a><xsl:attribute name="class">scripRef</xsl:attribute>
|
|
|
1465 <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
|
|
|
1466 <!-- if bcb, link to new window -->
|
|
|
1467 <xsl:attribute name="bcbTarg">true</xsl:attribute>
|
|
|
1468 <xsl:attribute name="href">/ccel/bible/<xsl:value-of
|
|
|
1469 select="$bibleID"/>.<xsl:value-of select="$bk"/>.<xsl:value-of
|
|
|
1470 select="$ch"/>.html#<xsl:value-of select="$bk"/>.<xsl:value-of
|
|
|
1471 select="$ch"/><xsl:value-of select="$vdot"/></xsl:attribute>
|
|
|
1472 <xsl:attribute name="name"><xsl:value-of select="translate(@parsed,'|','_')"/></xsl:attribute>
|
|
|
1473
|
|
|
1474 <xsl:value-of select="."/>
|
|
|
1475 </a>
|
|
|
1476 </xsl:template>
|
|
|
1477
|
|
|
1478
|
|
|
1479 <!-- a href: change "#sect-id" urls to "bookID.sect.html#id" if urls='ex' -->
|
|
|
1480 <xsl:template match="a" mode="includeParsing">
|
|
|
1481 <a>
|
|
|
1482 <xsl:copy-of select="@*[name() != 'href']"/>
|
|
|
1483 <xsl:if test="@href">
|
|
|
1484
|
|
|
1485 <!-- href with http://domain_name/ part stripped off -->
|
|
|
1486 <xsl:variable name="temphref">
|
|
|
1487 <xsl:choose>
|
|
|
1488 <xsl:when test="starts-with(@href,'http:')">/<xsl:value-of
|
|
|
1489 select="substring-after(substring-after(@href,'.'),'/')"/>
|
|
|
1490 </xsl:when>
|
|
|
1491 <xsl:otherwise><xsl:value-of select="@href"/></xsl:otherwise>
|
|
|
1492 </xsl:choose>
|
|
|
1493 </xsl:variable>
|
|
|
1494
|
|
|
1495 <!-- authorID of /ccel hrefs -->
|
|
|
1496 <xsl:variable name="linkauthorID">
|
|
|
1497 <xsl:choose>
|
|
|
1498 <xsl:when test="starts-with($temphref,'/ccel/')"><xsl:value-of
|
|
|
1499 select="substring-before(substring-after($temphref,
|
|
|
1500 '/ccel/'),'/')"/>
|
|
|
1501 </xsl:when>
|
|
|
1502 <xsl:when test="starts-with($temphref,'/')"><xsl:value-of
|
|
|
1503 select="substring-before(substring($temphref,4),'/')"/>
|
|
|
1504 </xsl:when>
|
|
|
1505 </xsl:choose>
|
|
|
1506 </xsl:variable>
|
|
|
1507
|
|
|
1508 <!-- authLet of /ccel hrefs -->
|
|
|
1509 <xsl:variable name="linkauthLet" select="substring($linkauthorID,1,1)"/>
|
|
|
1510
|
|
|
1511 <!-- bookID of /ccel href -->
|
|
|
1512 <xsl:variable name="linkbookID">
|
|
|
1513 <xsl:choose>
|
|
|
1514 <xsl:when test="starts-with($temphref,'/ccel/')"><xsl:value-of
|
|
|
1515 select="substring-before(substring-after(substring-after(
|
|
|
1516 $temphref,'/ccel/'),'/'),'.')"/></xsl:when>
|
|
|
1517 <xsl:when test="starts-with($temphref,'/')"><xsl:value-of
|
|
|
1518 select="substring-before(substring-after(substring($temphref,
|
|
|
1519 4),'/'),'/')"/></xsl:when>
|
|
|
1520 </xsl:choose>
|
|
|
1521 </xsl:variable>
|
|
|
1522
|
|
|
1523 <!-- the filename extension of the link -->
|
|
|
1524 <xsl:variable name="linktype">
|
|
|
1525 <xsl:call-template name="getlinktype">
|
|
|
1526 <xsl:with-param name="theText"
|
|
|
1527 select="substring-after($temphref,$linkbookID)"/>
|
|
|
1528 </xsl:call-template>
|
|
|
1529 </xsl:variable>
|
|
|
1530
|
|
|
1531 <xsl:attribute name="href">
|
|
|
1532 <xsl:choose>
|
|
|
1533
|
|
|
1534 <!-- with a non-#id URL, and one big file -->
|
|
|
1535 <xsl:when test="(substring(@href,1,1)!='#' and substring(@href,1,1)!='?') or $urls='in'">
|
|
|
1536 <xsl:value-of select="@href"/>
|
|
|
1537 </xsl:when>
|
|
|
1538
|
|
|
1539 <!-- a #xxx-yyy URI -->
|
|
|
1540 <xsl:otherwise>
|
|
|
1541 <xsl:variable name="hrefSect">
|
|
|
1542 <xsl:choose>
|
|
|
1543 <xsl:when test="contains(@href,'-')">
|
|
|
1544 <xsl:value-of select="substring-after(substring-before(@href,'-'),'#')"/>
|
|
|
1545 </xsl:when>
|
|
|
1546 <xsl:otherwise>
|
|
|
1547 <xsl:value-of select="substring-after(@href,'#')"/>
|
|
|
1548 </xsl:otherwise>
|
|
|
1549 </xsl:choose>
|
|
|
1550 </xsl:variable>
|
|
|
1551 <xsl:variable name="hrefHash">
|
|
|
1552 <xsl:choose>
|
|
|
1553 <xsl:when test="contains(@href,'-')">
|
|
|
1554 <xsl:value-of select="@href"/>
|
|
|
1555 </xsl:when>
|
|
|
1556 <xsl:when test="contains(@href,'?')">
|
|
|
1557 <xsl:value-of select="substring-before(@href,'#')"/>
|
|
|
1558 </xsl:when>
|
|
|
1559 <xsl:otherwise>
|
|
|
1560 </xsl:otherwise>
|
|
|
1561 </xsl:choose>
|
|
|
1562 </xsl:variable>
|
|
|
1563 <xsl:value-of select="$bookID"/>.<xsl:value-of
|
|
|
1564 select="$hrefSect"/><xsl:text>.html</xsl:text>
|
|
|
1565 <xsl:value-of select="$hrefHash"/>
|
|
|
1566
|
|
|
1567 </xsl:otherwise>
|
|
|
1568 </xsl:choose>
|
|
|
1569 </xsl:attribute>
|
|
|
1570 </xsl:if>
|
|
|
1571 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1572 </a>
|
|
|
1573 </xsl:template>
|
|
|
1574
|
|
|
1575 <!-- get extension of link -->
|
|
|
1576 <xsl:template name="getlinktype">
|
|
|
1577 <xsl:param name="theText"/>
|
|
|
1578 <xsl:choose>
|
|
|
1579 <xsl:when test="contains($theText,'.')">
|
|
|
1580 <xsl:call-template name="getlinktype">
|
|
|
1581 <xsl:with-param name="theText" select="substring-after($theText,'.')"/>
|
|
|
1582 </xsl:call-template>
|
|
|
1583 </xsl:when>
|
|
|
1584 <xsl:when test="contains($theText,'?')">
|
|
|
1585 <xsl:call-template name="getlinktype">
|
|
|
1586 <xsl:with-param name="theText" select="substring-before($theText,'?')"/>
|
|
|
1587 </xsl:call-template>
|
|
|
1588 </xsl:when>
|
|
|
1589 <xsl:when test="contains($theText,'#')">
|
|
|
1590 <xsl:call-template name="getlinktype">
|
|
|
1591 <xsl:with-param name="theText" select="substring-before($theText,'#')"/>
|
|
|
1592 </xsl:call-template>
|
|
|
1593 </xsl:when>
|
|
|
1594 <xsl:otherwise><xsl:value-of select="$theText"/></xsl:otherwise>
|
|
|
1595 </xsl:choose>
|
|
|
1596 </xsl:template>
|
|
|
1597
|
|
|
1598 <!-- pass through most HTML-compatible tags unchanged -->
|
|
|
1599 <xsl:template match="abbr|acronym|address|area|applet|b|bdo|big|blockquote|br|button|caption|center|cite|code|col|colgroup|dfn|del|dd|div|dl|dt|em|fieldset|font|form|frame|frameset|h1|h2|h3|h4|h5|h6|hr|i|iframe|img|input|ins|kbd|label|legend|li|map|noframes|object|ol|option|optgroup|p|param|pre|q|s|samp|script|select|small|strong|sub|sup|table|tbody|td|textarea|tfoot|th|thead|tr|tt|u|ul|var" mode="includeParsing">
|
|
|
1600 <xsl:element name="{local-name()}">
|
|
|
1601 <xsl:copy-of select="@*"/>
|
|
|
1602 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1603 </xsl:element>
|
|
|
1604 </xsl:template>
|
|
|
1605
|
|
|
1606
|
|
|
1607 <xsl:template match="span" mode="includeParsing">
|
|
|
1608 <span>
|
|
|
1609 <xsl:copy-of select="@*"/>
|
|
|
1610 <xsl:if test="@lang='HE' and not(@class)">
|
|
|
1611 <xsl:attribute name="class">Hebrew</xsl:attribute>
|
|
|
1612 </xsl:if>
|
|
|
1613 <xsl:if test="@lang='EL' and not(@class)">
|
|
|
1614 <xsl:attribute name="class">Greek</xsl:attribute>
|
|
|
1615 </xsl:if>
|
|
|
1616 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1617 </span>
|
|
|
1618 </xsl:template>
|
|
|
1619
|
|
|
1620
|
|
|
1621 <!-- process footnotes -->
|
|
|
1622 <xsl:template match="note" mode="includeParsing">
|
|
|
1623 <xsl:variable name="fref">fnf_<xsl:value-of select="@id"/></xsl:variable>
|
|
|
1624 <xsl:variable name="bref">fnb_<xsl:value-of select="@id"/></xsl:variable>
|
|
|
1625 <xsl:variable name="noteRef"><xsl:choose><xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when><xsl:otherwise><xsl:value-of select="count(preceding::note | ancestor::note | preceding-sibling::note) + 1"/></xsl:otherwise></xsl:choose></xsl:variable>
|
|
|
1626
|
|
|
1627 <!-- notes processing, footnote mode -->
|
|
|
1628 <xsl:if test="$myNotes='foot'">
|
|
|
1629 <a class="Note">
|
|
|
1630 <xsl:attribute name="name"><xsl:value-of select="$bref"/></xsl:attribute>
|
|
|
1631 <xsl:attribute name="href">#<xsl:value-of select="$fref"/></xsl:attribute>
|
|
|
1632 <sup class="Note"><xsl:value-of select="$noteRef"/></sup>
|
|
|
1633 </a>
|
|
|
1634 </xsl:if>
|
|
|
1635
|
|
|
1636 <!-- notes processing, marginal notes mode -->
|
|
|
1637 <xsl:if test="$myNotes='margin' or $myNotes='hidden'">
|
|
|
1638 <a class="Note">
|
|
|
1639 <xsl:attribute name="href">javascript:toggle('<xsl:value-of select="$fref"/>');</xsl:attribute>
|
|
|
1640 <sup class="Note"><xsl:value-of select="$noteRef"/></sup>
|
|
|
1641 </a>
|
|
|
1642 <span class="mnote">
|
|
|
1643 <xsl:if test="$myNotes='hidden'"><xsl:attribute name="style">display: none</xsl:attribute></xsl:if>
|
|
|
1644 <xsl:attribute name="id"><xsl:value-of select="$fref"/></xsl:attribute><xsl:text> </xsl:text>
|
|
|
1645 <a class="Note">
|
|
|
1646 <xsl:attribute name="name">#<xsl:value-of select="$fref"/></xsl:attribute>
|
|
|
1647 <sup class="NoteRef">
|
|
|
1648 <xsl:value-of select="$noteRef"/>
|
|
|
1649 </sup>
|
|
|
1650 </a>
|
|
|
1651 <xsl:apply-templates mode="createNotesContent"/>
|
|
|
1652 </span>
|
|
|
1653
|
|
|
1654 </xsl:if>
|
|
|
1655
|
|
|
1656 </xsl:template>
|
|
|
1657
|
|
|
1658 <xsl:template match="div1|div2|div3|div4|div5" mode="createNotes">
|
|
|
1659 <!-- do nothing -->
|
|
|
1660 </xsl:template>
|
|
|
1661
|
|
|
1662 <xsl:template match="note" mode="createNotes">
|
|
|
1663 <xsl:variable name="fref">fnf_<xsl:value-of select="@id"/></xsl:variable>
|
|
|
1664 <xsl:variable name="bref">fnb_<xsl:value-of select="@id"/></xsl:variable>
|
|
|
1665 <xsl:variable name="noteRef"><xsl:choose><xsl:when test="@n"><xsl:value-of select="@n"/></xsl:when><xsl:otherwise><xsl:value-of select="count(preceding::note | ancestor::note | preceding-sibling::note) + 1"/></xsl:otherwise></xsl:choose></xsl:variable>
|
|
|
1666
|
|
|
1667 <p class="noteMark">
|
|
|
1668 <a class="Note">
|
|
|
1669 <xsl:attribute name="name"><xsl:value-of select="$fref"/></xsl:attribute>
|
|
|
1670 <xsl:attribute name="href">#<xsl:value-of select="$bref"/></xsl:attribute>
|
|
|
1671 <sup class="NoteRef"><xsl:value-of select="$noteRef"/></sup>
|
|
|
1672 </a>
|
|
|
1673 </p>
|
|
|
1674 <div class="Note">
|
|
|
1675 <xsl:attribute name="id"><xsl:value-of select="$fref"/></xsl:attribute>
|
|
|
1676 <xsl:apply-templates mode="includeParsing"/>
|
|
|
1677 </div>
|
|
|
1678 </xsl:template>
|
|
|
1679
|
|
|
1680 <xsl:template match="text()" mode="createNotes">
|
|
|
1681 </xsl:template>
|
|
|
1682
|
|
|
1683 <xsl:template match="text()" mode="includeParsing">
|
|
|
1684 <xsl:choose>
|
|
|
1685 <xsl:when test="$words != '1'">
|
|
|
1686 <xsl:value-of select="."/>
|
|
|
1687 </xsl:when>
|
|
|
1688 <xsl:otherwise>
|
|
|
1689 <xsl:call-template name="linkWords">
|
|
|
1690 <xsl:with-param name="theText" select="normalize-space()"/>
|
|
|
1691 <xsl:with-param name="id">
|
|
|
1692 <xsl:value-of select="../@id"/><xsl:text>.</xsl:text>
|
|
|
1693 <xsl:value-of select="position()"/>
|
|
|
1694 </xsl:with-param>
|
|
|
1695 <xsl:with-param name="word" select="0"/>
|
|
|
1696 </xsl:call-template>
|
|
|
1697 </xsl:otherwise>
|
|
|
1698 </xsl:choose>
|
|
|
1699 </xsl:template>
|
|
|
1700
|
|
|
1701 <!-- linkWords: put <a> around each word, so you can process it with
|
|
|
1702 javascript, e.g. right-click to look it up in a dictionary -->
|
|
|
1703 <xsl:template name="linkWords">
|
|
|
1704 <xsl:choose>
|
|
|
1705 <xsl:when test="$theText=''"></xsl:when>
|
|
|
1706 <xsl:when test="$theText=' '"><xsl:text> </xsl:text></xsl:when>
|
|
|
1707 <xsl:when test="substring-before($theText,' ')=''">
|
|
|
1708 <a id="{$id}.w{$word}"><xsl:value-of select="$theText"/></a><xsl:text>
|
|
|
1709 </xsl:text>
|
|
|
1710 </xsl:when>
|
|
|
1711 <xsl:otherwise>
|
|
|
1712 <a id="{$id}.w{$word}">
|
|
|
1713 <xsl:value-of select="substring-before($theText,' ')"/>
|
|
|
1714 </a><xsl:text>
|
|
|
1715 </xsl:text>
|
|
|
1716 <xsl:call-template name="linkWords">
|
|
|
1717 <xsl:with-param name="theText" select="substring-after($theText,' ')"/>
|
|
|
1718 <xsl:with-param name="word" select="$word + 1"/>
|
|
|
1719 <xsl:with-param name="id" select="$id"/>
|
|
|
1720 </xsl:call-template>
|
|
|
1721 </xsl:otherwise>
|
|
|
1722 </xsl:choose>
|
|
|
1723
|
|
|
1724 </xsl:template>
|
|
|
1725
|
|
|
1726 <!-- look-up table mapping language codes to names -->
|
|
|
1727 <lang:name code="en">English</lang:name>
|
|
|
1728 <lang:name code="zh">Chinese</lang:name>
|
|
|
1729 <lang:name code="cn">Chinese</lang:name>
|
|
|
1730 <lang:name code="nl">Dutch</lang:name>
|
|
|
1731 <lang:name code="fr">French</lang:name>
|
|
|
1732 <lang:name code="fy">Frisian</lang:name>
|
|
|
1733 <lang:name code="de">German</lang:name>
|
|
|
1734 <lang:name code="el">Greek</lang:name>
|
|
|
1735 <lang:name code="he">Hebrew</lang:name>
|
|
|
1736 <lang:name code="it">Italian</lang:name>
|
|
|
1737 <lang:name code="la">Latin</lang:name>
|
|
|
1738 <lang:name code="pt">Portuguese</lang:name>
|
|
|
1739 <lang:name code="ru">Russian</lang:name>
|
|
|
1740 <lang:name code="es">Spanish</lang:name>
|
|
|
1741
|
|
|
1742 <!--This list is used to generate the contents for a dictionary-->
|
|
|
1743 <letter:alphabet>
|
|
|
1744 <letter:letter>a</letter:letter>
|
|
|
1745 <letter:letter>b</letter:letter>
|
|
|
1746 <letter:letter>c</letter:letter>
|
|
|
1747 <letter:letter>d</letter:letter>
|
|
|
1748 <letter:letter>e</letter:letter>
|
|
|
1749 <letter:letter>f</letter:letter>
|
|
|
1750 <letter:letter>g</letter:letter>
|
|
|
1751 <letter:letter>h</letter:letter>
|
|
|
1752 <letter:letter>i</letter:letter>
|
|
|
1753 <letter:letter>j</letter:letter>
|
|
|
1754 <letter:letter>k</letter:letter>
|
|
|
1755 <letter:letter>l</letter:letter>
|
|
|
1756 <letter:letter>m</letter:letter>
|
|
|
1757 <letter:letter>n</letter:letter>
|
|
|
1758 <letter:letter>o</letter:letter>
|
|
|
1759 <letter:letter>p</letter:letter>
|
|
|
1760 <letter:letter>q</letter:letter>
|
|
|
1761 <letter:letter>r</letter:letter>
|
|
|
1762 <letter:letter>s</letter:letter>
|
|
|
1763 <letter:letter>t</letter:letter>
|
|
|
1764 <letter:letter>u</letter:letter>
|
|
|
1765 <letter:letter>v</letter:letter>
|
|
|
1766 <letter:letter>w</letter:letter>
|
|
|
1767 <letter:letter>x</letter:letter>
|
|
|
1768 <letter:letter>y</letter:letter>
|
|
|
1769 <letter:letter>z</letter:letter>
|
|
|
1770 </letter:alphabet>
|
|
|
1771
|
|
|
1772 <xsl:template name="url-encode">
|
|
|
1773 <xsl:param name="str"/>
|
|
|
1774 <xsl:param name="isRec"/>
|
|
|
1775 <xsl:if test="$str">
|
|
|
1776 <xsl:variable name = "trans">
|
|
|
1777 <xsl:value-of select="translate($str,$termTrans,'abcdefghijklmnopqrstuvwxyz+')"/>
|
|
|
1778 </xsl:variable>
|
|
|
1779 <xsl:choose>
|
|
|
1780 <xsl:when test="$desktop=0">
|
|
|
1781 <xsl:value-of select="str:encode-uri($trans,true())"/>
|
|
|
1782 </xsl:when>
|
|
|
1783 <xsl:otherwise>
|
|
|
1784 <xsl:value-of select="translate($trans,' ','+')"/>
|
|
|
1785 </xsl:otherwise>
|
|
|
1786 </xsl:choose>
|
|
|
1787 </xsl:if>
|
|
|
1788 </xsl:template>
|
|
|
1789
|
|
|
1790 <xsl:template name="url-decode">
|
|
|
1791 <xsl:param name="encoded"/>
|
|
|
1792 <xsl:if test="$encoded">
|
|
|
1793 <xsl:choose>
|
|
|
1794 <xsl:when test="$desktop=0">
|
|
|
1795 <xsl:value-of select="str:decode-uri($encoded)"/>
|
|
|
1796 </xsl:when>
|
|
|
1797 <xsl:otherwise>
|
|
|
1798 <xsl:value-of select="$encoded"/>
|
|
|
1799 </xsl:otherwise>
|
|
|
1800 </xsl:choose>
|
|
|
1801 </xsl:if>
|
|
|
1802 </xsl:template>
|
|
|
1803 </xsl:stylesheet>
|