Project

Profile

Help

How to connect?
Download (5.65 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.8.0.14 / samples / styles / bible.xsl @ 02f8308b

1
<xsl:stylesheet
2
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
3

    
4
<xsl:strip-space elements="*"/>
5

    
6
<!-- parameter "dir" must be set from the command line: it represents the output directory -->
7
<xsl:param name="dir">bible</xsl:param>
8

    
9
<xsl:output name="index" method="html"/>
10
<xsl:output name="book" method="html"/>
11
<xsl:output name="chapter" method="html"/>
12

    
13
<xsl:template match="tstmt">
14
    <xsl:result-document href="file:///{$dir}/index.html" format="index">
15
        <html><frameset rows="15%,*">
16
            <noframes>You need a browser that allows frames</noframes>
17
            <frame src="titlepage.html" />
18
            <frame src="index2.html" />
19
        </frameset></html>
20
    </xsl:result-document>
21
    <xsl:result-document href="file:///{$dir}/index2.html" format="index">
22
        <html><frameset cols="16%,14%,*">
23
            <noframes>You need a browser that allows frames</noframes>
24
            <frame src="books.html" />
25
            <frame src="book1.html" name="chapters" />
26
            <frame src="chap1.1.html" name="content" />
27
        </frameset></html>
28
    </xsl:result-document>
29
    <xsl:result-document href="file:///{$dir}/titlepage.html" format="index">
30
        <html><body bgcolor="#008080" text="#ffffff" link="#00ffff" vlink="#00cccc">
31
        <font face="sans-serif">
32
            <xsl:apply-templates/>
33
        </font>
34
        <xsl:if test="preface">
35
            <a href="preface.html" target="_blank">Preface</a>
36
        </xsl:if>
37
        <div align="right"><a href="coverpage.html" target="_blank">Source</a></div>
38
        </body></html>
39
    </xsl:result-document>
40
</xsl:template>
41

    
42
<xsl:template match="coverpg">
43
    <xsl:result-document href="file:///{$dir}/coverpage.html" format="book">
44
        <html><body bgcolor="#00eeee"><center>
45
            <xsl:apply-templates/>
46
        <hr/>This HTML Rendition produced from John Bosak's XML source by
47
             <a href="mailto:Michael.H.Kay@ntlworld.com">Michael Kay</a>
48
        <hr/></center>
49
        </body></html>
50
    </xsl:result-document>
51
</xsl:template>
52

    
53
<xsl:template match="titlepg">
54
    <xsl:apply-templates/>
55
</xsl:template>
56

    
57
<xsl:template match="title">
58
    <center><font size="5"><b>
59
        <xsl:apply-templates/>
60
    </b></font></center>
61
</xsl:template>
62

    
63
<xsl:template match="title2">
64
    <center><font size="2">
65
        <xsl:apply-templates/>
66
    <br/></font></center>
67
</xsl:template>
68

    
69
<xsl:template match="subtitle">
70
    <xsl:apply-templates/>
71
</xsl:template>
72

    
73
<xsl:template match="preface">
74
    <xsl:result-document href="file:///{$dir}/preface.html" format="chapter">
75
        <html><body bgcolor="#00eeee"><center>
76
            <xsl:apply-templates/>
77
        </center><hr/></body></html>
78
    </xsl:result-document>
79
</xsl:template>
80

    
81
<xsl:template match="ptitle">
82
    <h2>
83
        <xsl:apply-templates/>
84
    </h2>
85
</xsl:template>
86

    
87
<xsl:template match="ptitle0">
88
    <p><font size="7" color="red">
89
        <xsl:apply-templates/>
90
    </font></p>
91
</xsl:template>
92

    
93
<xsl:template match="bookcoll">
94
    <xsl:result-document href="file:///{$dir}/books.html" format="book">
95
        <html><body bgcolor="#00c0c0">
96
        <font face="sans-serif" size="2">
97
        <script language="JavaScript">
98
        <xsl:comment>
99
            function bk(n) {
100
                parent.frames['content'].location="chap" + n + ".1.html";
101
            }
102
            //</xsl:comment>
103
        </script>
104
        <xsl:apply-templates/>
105
        </font>
106
        </body></html>
107
    </xsl:result-document>
108
</xsl:template>
109

    
110
<xsl:template match="book">
111
    <xsl:variable name="booknr"><xsl:number count="book"/></xsl:variable>
112
    <xsl:result-document href="file:///{$dir}/book{$booknr}.html" format="book">
113
        <html><body bgcolor="#00FFFF"><font face="sans-serif" size="2">
114
            <xsl:apply-templates>
115
                <xsl:with-param name="booknr" select="$booknr"/>
116
            </xsl:apply-templates>
117
        </font></body></html>
118
    </xsl:result-document>
119
    <a href="book{$booknr}.html" target="chapters" onClick="bk({$booknr})">
120
        <xsl:value-of select="bktshort"/>
121
    </a><br/>
122
</xsl:template>
123

    
124
<xsl:template match="bktlong"/>
125

    
126
<xsl:template match="bktshort">
127
	<h2><xsl:value-of select="."/></h2>
128
</xsl:template>
129

    
130
<xsl:template match="chapter">
131
    <xsl:param name="booknr"/>
132
    <xsl:variable name="chapnr"><xsl:number count="chapter"/></xsl:variable>
133
    <xsl:variable name="chapfile" select="concat('chap', $booknr, '.', $chapnr, '.html')"/> 
134
    <xsl:result-document href="file:///{$dir}/{$chapfile}" format="chapter">
135
        <html><head><title>
136
        <xsl:value-of select="ancestor::book/bktshort"/>
137
        </title></head>
138

    
139
        <body text="#000080"><H2><font face="sans-serif">
140
        <xsl:value-of select="ancestor::book/bktlong"/>
141
        </font></H2>
142
        <table>
143
            <xsl:apply-templates/>        
144
        </table><hr/>
145
        </body></html>
146
    </xsl:result-document>
147
    <a href="{$chapfile}" target="content">
148
        <xsl:value-of select="chtitle"/>
149
    </a><br/>
150
</xsl:template>
151

    
152
<xsl:template match="chtitle">
153
    <h2>
154
	    <xsl:apply-templates/>
155
	</h2>
156
</xsl:template>
157

    
158
<xsl:template match="v">
159
    <xsl:variable name="pos"><xsl:number/></xsl:variable>
160
    <tr><td valign="top">
161
    <xsl:choose>
162
    <xsl:when test="$pos=1">
163
        <b><xsl:apply-templates/></b>
164
    </xsl:when>
165
    <xsl:otherwise>
166
        <xsl:apply-templates/>
167
    </xsl:otherwise>
168
    </xsl:choose>
169
    </td>
170
    <td width="10"></td>
171
    <td valign="top"><font color="#808080">
172
        <xsl:copy-of select="$pos"/>
173
    </font></td>
174
    </tr>
175
</xsl:template>
176

    
177
<xsl:template match="div">
178
	<xsl:apply-templates/>
179
</xsl:template>
180

    
181
<xsl:template match="divtitle">
182
    <tr><td valign="TOP"><font color="green">
183
	<xsl:apply-templates/>
184
    </font></td></tr>
185
</xsl:template>
186

    
187
</xsl:stylesheet>	
(2-2/12)