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