stylesheet.xsl 14 KB
Newer Older
Davis King's avatar
Davis King committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="ISO-8859-1" ?>
   
<!--
   To the extent possible under law, Davis E King  has waived all copyright and 
   related or neighboring rights to dlib documentation (XML, HTML, and XSLT files).
   This work is published from United States. 
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes' />
   
   
   <!-- ************************************************************************* -->

   <xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz </xsl:variable>
   <xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ </xsl:variable>
   
   <!-- ************************************************************************* -->

   <xsl:template match="/doc">
      <html>
         <head>
            <title>
               <xsl:if test="title">
Davis King's avatar
Davis King committed
25
                 <xsl:value-of select="title" />
Davis King's avatar
Davis King committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
               </xsl:if>
            </title>


            <!-- [client side code for collapsing and unfolding branches] -->
            <script language="JavaScript">

            // ---------------------------------------------
            // --- Name:    Easy DHTML Treeview           --
            // --- Author:  D.D. de Kerf                  --
            // --- Version: 0.2          Date: 13-6-2001  --
            // ---------------------------------------------
            function Toggle(node)
            {
               // Unfold the branch if it isn't visible
               var next_node = node.nextSibling;
               if (next_node.style.display == 'none')
               {
                  // Change the image (if there is an image)
                  if (node.childNodes.length > 0)
                  {
                     if (node.childNodes.length > 0)
                     { 
                        if (node.childNodes.item(0).nodeName == "IMG")
                        {
                           node.childNodes.item(0).src = "minus.gif";
                        }
                     }
                  }

                  next_node.style.display = 'block';
               }
               // Collapse the branch if it IS visible
               else
               {
                  // Change the image (if there is an image)
                  if (node.childNodes.length > 0)
                  {
                     if (node.childNodes.length > 0)
                     { 
                        if (node.childNodes.item(0).nodeName == "IMG")
                        {
                           node.childNodes.item(0).src = "plus.gif";
                        }
                     }
                  }

                  next_node.style.display = 'none';
               }

Davis King's avatar
Davis King committed
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
            }
            function BigToggle(node)
            {
               // Unfold the branch if it isn't visible
               var next_node = node.nextSibling;
               if (next_node.style.display == 'none')
               {
                  // Change the image (if there is an image)
                  if (node.childNodes.length > 0)
                  {
                     if (node.childNodes.length > 0)
                     { 
                        if (node.childNodes.item(0).nodeName == "IMG")
                        {
                           node.childNodes.item(0).src = "bigminus.gif";
                        }
                     }
                  }

                  next_node.style.display = 'block';
               }
               // Collapse the branch if it IS visible
               else
               {
                  // Change the image (if there is an image)
                  if (node.childNodes.length > 0)
                  {
                     if (node.childNodes.length > 0)
                     { 
                        if (node.childNodes.item(0).nodeName == "IMG")
                        {
                           node.childNodes.item(0).src = "bigplus.gif";
                        }
                     }
                  }

                  next_node.style.display = 'none';
               }

Davis King's avatar
Davis King committed
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
            }
            </script>
            
            <style type="text/css">
               pre {margin:0px;}

               ul.tree  li { list-style: none;  margin-left:10px;} 
               ul.tree  { margin:0px; padding:0px; margin-left:5px; font-size:0.95em; }
               ul.tree  li ul { margin-left:10px; padding:0px; }

               div#component {
                  background-color:white; 
                  border: 2px solid rgb(102,102,102); 
                  text-align:left;
                  margin-top: 1.5em;
                  padding: 0.7em;
               }

               div#function {
                  background-color:white; 
                  border: 2px solid rgb(102,102,255); 
                  text-align:left;
                  margin-top: 0.3em;
                  padding: 0.3em;
               }

               div#class {
                  background-color:white; 
                  border: 2px solid rgb(255,102,102); 
                  text-align:left;
                  margin-top: 0.3em;
                  padding: 0.3em;
               }

            </style>
         </head>
         <body>
            <xsl:if test="title">
               <center><h1> <xsl:value-of select="title" /> </h1></center>
            </xsl:if>
            <xsl:apply-templates select="body"/>
         </body>
      </html>
   </xsl:template>
   
         


   
   <!-- ************************************************************************* -->
         
   <xsl:template match="body">
       <xsl:choose>
           <xsl:when test="@from_file">
               <xsl:apply-templates select="document(@from_file)"/>            
               <xsl:apply-templates/>
         </xsl:when>
           <xsl:otherwise>
               <xsl:apply-templates/>
           </xsl:otherwise>
       </xsl:choose>
   </xsl:template>

   
   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->
   <!-- XSLT for dealing with <code> blocks generated by the htmlify to-xml option -->
   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->

   <xsl:template match="code">

      <h1>Classes and Structs:</h1>
      <xsl:for-each select="classes/class">  
         <xsl:sort select="translate(concat(name,.),$lcletters, $ucletters)"/>  
         <xsl:apply-templates select="."/>
      </xsl:for-each>

      <h1>Global Functions:</h1>
      <xsl:for-each select="global_functions/function">  
         <xsl:sort select="translate(concat(name,.),$lcletters, $ucletters)"/>  
         <div id="function">
            <a onclick="Toggle(this)" style="cursor: pointer"><img src="plus.gif" border="0"/><font color="blue">
               <u><b><xsl:value-of select="name"/>()</b></u></font></a>
            <div style="display:none;">
               <br/>
               <xsl:if test="scope != ''">
                  <u>Scope</u>: <xsl:value-of select="scope"/> <br/>
               </xsl:if>
               <u>File</u>: <xsl:value-of select="file"/> <br/><br/>
               <div style="margin-left:1.5em">
               <pre style="font-size:1.1em;"><xsl:value-of select="declaration"/>;</pre> 
               <font color="#009900"><pre><xsl:value-of select="comment"/></pre></font> 
               </div>
               <br/>
            </div>
         </div>
      </xsl:for-each>

   </xsl:template>

   <!-- ************************************************************************* -->

   <xsl:template match="class">
         <div id="class">
            <a onclick="Toggle(this)" style="cursor: pointer"><img src="plus.gif" border="0"/><font color="blue">
               <u><b><xsl:value-of select="name"/></b></u></font></a>
            <div style="display:none;">
               <br/>
               <xsl:if test="scope != ''">
                  <u>Scope</u>: <xsl:value-of select="scope"/> <br/>
               </xsl:if>
               <u>File</u>: <xsl:value-of select="file"/> <br/><br/>
               <div style="margin-left:1.5em">
               <pre style="font-size:1.1em;"><xsl:value-of select="declaration"/>;</pre> <br/>
               <font color="#009900"><pre><xsl:value-of select="comment"/></pre></font> <br/>
               </div>

Davis King's avatar
Davis King committed
233
234
235
236
237
238
239
240
241
242
243
244
245
               <xsl:if test="protected_typedefs">
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Protected Typedefs</u></font></a>
                     <div style="display:none;">
                        <ul>
                           <xsl:for-each select="protected_typedefs/typedef">
                              <li><xsl:value-of select="."/>;</li>
                           </xsl:for-each>
                        </ul>
                     </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
246
               <xsl:if test="public_typedefs">
Davis King's avatar
Davis King committed
247
248
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0" style="size:2em"/><font color="blue">
                     <u style="font-size:2em">Public Typedefs</u></font></a>
Davis King's avatar
Davis King committed
249
250
251
252
253
254
255
256
257
258
                     <div style="display:none;">
                        <ul>
                           <xsl:for-each select="public_typedefs/typedef">
                              <li><xsl:value-of select="."/>;</li>
                           </xsl:for-each>
                        </ul>
                     </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
259
260
261
262
263
264
265
266
267
268
269
270
271
               <xsl:if test="protected_variables">
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Protected Variables</u></font></a>
                  <div style="display:none;">
                     <ul>
                        <xsl:for-each select="protected_variables/variable">
                           <li><xsl:value-of select="."/>;</li>
                        </xsl:for-each>
                     </ul>
                  </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
272
               <xsl:if test="public_variables">
Davis King's avatar
Davis King committed
273
274
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Public Variables</u></font></a>
Davis King's avatar
Davis King committed
275
276
277
278
279
280
281
282
283
284
                  <div style="display:none;">
                     <ul>
                        <xsl:for-each select="public_variables/variable">
                           <li><xsl:value-of select="."/>;</li>
                        </xsl:for-each>
                     </ul>
                  </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
               <xsl:if test="protected_methods">
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Protected Methods</u></font></a>
                  <div style="display:none;">
                  <xsl:for-each select="protected_methods/method">
                     <div id="function">
                        <u>Method Name</u>: <b><xsl:value-of select="name"/></b> <br/><br/>
                        <div style="margin-left:1.5em">
                           <pre style="font-size:1.1em;"><xsl:value-of select="declaration"/>;</pre> 
                           <font color="#009900"><pre><xsl:value-of select="comment"/></pre></font> <br/>
                        </div>
                     </div>
                  </xsl:for-each>
                  </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
302
               <xsl:if test="public_methods">
Davis King's avatar
Davis King committed
303
304
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Public Methods</u></font></a>
Davis King's avatar
Davis King committed
305
306
307
308
309
310
311
312
313
314
315
316
317
318
                  <div style="display:none;">
                  <xsl:for-each select="public_methods/method">
                     <div id="function">
                        <u>Method Name</u>: <b><xsl:value-of select="name"/></b> <br/><br/>
                        <div style="margin-left:1.5em">
                           <pre style="font-size:1.1em;"><xsl:value-of select="declaration"/>;</pre> 
                           <font color="#009900"><pre><xsl:value-of select="comment"/></pre></font> <br/>
                        </div>
                     </div>
                  </xsl:for-each>
                  </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
319
320
321
322
323
324
325
326
327
328
329
               <xsl:if test="protected_inner_classes">
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Protected Inner Classes</u></font></a>
                  <div style="display:none;">
                  <xsl:for-each select="protected_inner_classes/class">
                     <xsl:apply-templates select="."/>
                  </xsl:for-each>
                  </div>
                  <br/>
               </xsl:if>

Davis King's avatar
Davis King committed
330
               <xsl:if test="public_inner_classes">
Davis King's avatar
Davis King committed
331
332
                  <a onclick="BigToggle(this)" style="cursor: pointer"><img src="bigplus.gif" border="0"/><font color="blue">
                     <u style="font-size:2em">Public Inner Classes</u></font></a>
Davis King's avatar
Davis King committed
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
                  <div style="display:none;">
                  <xsl:for-each select="public_inner_classes/class">
                     <xsl:apply-templates select="."/>
                  </xsl:for-each>
                  </div>
                  <br/>
               </xsl:if>

            </div>
         </div>
   </xsl:template>


   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->
   <!-- ************************************************************************* -->



   
</xsl:stylesheet>