s/parsed-grammar/schema/
[cxml-rng.git] / doc / html.xsl
blob33fd8ab52323cd97ed6f827b1a3981af23d433f3
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2 <xsl:output method="html"
3 indent="yes"
4 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
5 doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
7 <xsl:template match="documentation">
8 <html>
9 <head>
10 <title>
11 <xsl:value-of select="@title"/>
12 </title>
13 <link rel="stylesheet" type="text/css" href="doc.css"/>
14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
15 </head>
16 <body>
17 <xsl:call-template name="header"/>
18 <div class="main">
19 Index of packages:
20 <xsl:apply-templates/>
21 </div>
22 </body>
23 </html>
24 </xsl:template>
26 <xsl:template match="arguments">
27 <h3>Arguments</h3>
28 <div class="indent">
29 <ul>
30 <xsl:for-each select="arg">
31 <li>
32 <tt>
33 <xsl:value-of select="@arg"/>
34 </tt>
35 <xsl:text> -- </xsl:text>
36 <xsl:apply-templates/>
37 </li>
38 </xsl:for-each>
39 </ul>
40 </div>
41 </xsl:template>
43 <xsl:template name="main-left">
44 <xsl:apply-templates select="arguments"/>
45 <xsl:choose>
46 <xsl:when test="documentation-string">
47 <h3>Details<a name="details"/></h3>
48 <xsl:apply-templates select="documentation-string"/>
49 </xsl:when>
50 <xsl:otherwise>
51 <p style="color: red; font-weight: bold">
52 No documentation string. Possibly unimplemented or incomplete.
53 </p>
54 </xsl:otherwise>
55 </xsl:choose>
56 <xsl:apply-templates select="implementation-note"/>
57 </xsl:template>
59 <xsl:template name="main-right">
60 <xsl:if test="see-also/constructor">
61 <h3>Returned by</h3>
62 <div class="indent">
63 <table cellspacing="0" cellpadding="0">
64 <xsl:apply-templates select="see-also/constructor/see"/>
65 </table>
66 </div>
67 </xsl:if>
68 <xsl:if test="see-also/slot">
69 <h3>Slot Access Functions</h3>
70 <div class="indent">
71 <table cellspacing="0" cellpadding="0">
72 <xsl:apply-templates select="see-also/slot/see"/>
73 </table>
74 </div>
75 </xsl:if>
76 <xsl:if test="see-also/other">
77 <h3>See also</h3>
78 <div class="indent">
79 <table cellspacing="0" cellpadding="0">
80 <xsl:apply-templates select="see-also/other/see"/>
81 </table>
82 </div>
83 </xsl:if>
84 </xsl:template>
86 <xsl:template name="main">
87 <xsl:choose>
88 <xsl:when test="see-also">
89 <table cellspacing="0" cellpadding="0">
90 <tr>
91 <td valign="top" width="60%">
92 <xsl:call-template name="main-left"/>
93 </td>
94 <td valign="top" width="5%">
95 &#160;
96 </td>
97 <td valign="top" width="35%">
98 <xsl:call-template name="main-right"/>
99 </td>
100 </tr>
101 </table>
102 </xsl:when>
103 <xsl:otherwise>
104 <xsl:call-template name="main-left"/>
105 </xsl:otherwise>
106 </xsl:choose>
107 </xsl:template>
109 <xsl:template match="package">
110 <h2>
111 <a href="pages/{@id}.html">
112 Package
113 <xsl:value-of select="@name"/>
114 </a>
115 </h2>
116 <div style="left: 100px">
117 <xsl:apply-templates select="documentation-string"/>
118 </div>
119 <xsl:document href="pages/{@id}.html"
120 method="html"
121 indent="yes"
122 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
123 doctype-system="http://www.w3.org/TR/html4/loose.dtd">
124 <html>
125 <head>
126 <title>
127 <xsl:text>Package </xsl:text>
128 <xsl:value-of select="@name"/>
129 </title>
130 <link rel="stylesheet" type="text/css" href="../doc.css"/>
131 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
132 </head>
133 <body>
134 <xsl:call-template name="page-header"/>
135 <div class="main">
136 <p class="noindent">
138 <a href="../index.html">
139 <xsl:value-of select="/documentation/@title"/>
140 </a>
141 </p>
142 <h1>
143 Package
144 <xsl:value-of select="@name"/>
145 </h1>
146 <xsl:apply-templates select="documentation-string"/>
147 <table cellspacing="0" cellpadding="0">
148 <tr>
149 <td valign="top">
150 <xsl:if test="sections">
151 <div style="margin-left: -30px">
152 <h3>About This Package</h3>
153 </div>
154 <xsl:apply-templates select="sections/section" mode="toc"/>
155 <br/>
156 <xsl:apply-templates select="sections"/>
157 </xsl:if>
158 </td>
159 <td valign="top">
160 <h3><a name="index"></a>Symbol Index</h3>
161 <xsl:apply-templates select="symbols" mode="symbol-index"/>
162 </td>
163 </tr>
164 </table>
165 </div>
166 </body>
167 </html>
168 </xsl:document>
169 </xsl:template>
171 <xsl:template match="*" mode="symbol-index"/>
173 <xsl:template match="symbols" mode="symbol-index">
174 <xsl:apply-templates mode="symbol-index">
175 <xsl:sort select="@id" data-type="text" order="ascending"/>
176 </xsl:apply-templates>
177 </xsl:template>
179 <xsl:template match="class" mode="symbol-index">
180 <a href="{@id}.html">
181 <tt><xsl:value-of select="@name"/></tt>
182 </a>
183 <xsl:text>, class</xsl:text>
184 <xsl:call-template name="undocumented"/>
185 <br/>
187 <xsl:document href="{@id}.html"
188 method="html"
189 indent="yes"
190 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
191 doctype-system="http://www.w3.org/TR/html4/loose.dtd">
192 <html>
193 <head>
194 <title>
195 <xsl:text>Class </xsl:text>
196 <xsl:value-of select="@name"/>
197 </title>
198 <link rel="stylesheet" type="text/css" href="../doc.css"/>
199 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
200 </head>
201 <body>
202 <xsl:call-template name="page-header"/>
203 <div class="main">
204 <p class="noindent">
205 Package:
206 <a href="{../../@id}.html">
207 <xsl:value-of select="../../@name"/>
208 </a>
209 </p>
210 <xsl:apply-templates select="." mode="page"/>
211 </div>
212 </body>
213 </html>
214 </xsl:document>
215 </xsl:template>
217 <xsl:template match="function" mode="symbol-index">
218 <a href="{@id}.html">
219 <tt><xsl:value-of select="@name"/></tt>
220 </a>
221 <xsl:text>, function</xsl:text>
222 <xsl:call-template name="undocumented"/>
223 <br/>
225 <xsl:document href="{@id}.html"
226 method="html"
227 indent="yes"
228 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
229 doctype-system="http://www.w3.org/TR/html4/loose.dtd">
230 <html>
231 <head>
232 <title>
233 <xsl:text>Function </xsl:text>
234 <xsl:value-of select="@name"/>
235 </title>
236 <link rel="stylesheet" type="text/css" href="../doc.css"/>
237 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
238 </head>
239 <body>
240 <xsl:call-template name="page-header"/>
241 <div class="main">
242 <p class="noindent">
243 Package:
244 <a href="{../../@id}.html">
245 <xsl:value-of select="../../@name"/>
246 </a>
247 </p>
248 <xsl:apply-templates select="." mode="page"/>
249 </div>
250 </body>
251 </html>
252 </xsl:document>
253 </xsl:template>
255 <xsl:template match="macro" mode="symbol-index">
256 <a href="{@id}.html">
257 <tt><xsl:value-of select="@name"/></tt>
258 </a>
259 <xsl:text>, macro</xsl:text>
260 <xsl:call-template name="undocumented"/>
261 <br/>
263 <xsl:document href="{@id}.html"
264 method="html"
265 indent="yes"
266 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
267 doctype-system="http://www.w3.org/TR/html4/loose.dtd">
268 <html>
269 <head>
270 <title>
271 <xsl:text>Macro </xsl:text>
272 <xsl:value-of select="@name"/>
273 </title>
274 <link rel="stylesheet" type="text/css" href="../doc.css"/>
275 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
276 </head>
277 <body>
278 <xsl:call-template name="page-header"/>
279 <div class="main">
280 <p class="noindent">
281 Package:
282 <a href="{../../@id}.html">
283 <xsl:value-of select="../../@name"/>
284 </a>
285 </p>
286 <xsl:apply-templates select="." mode="page"/>
287 </div>
288 </body>
289 </html>
290 </xsl:document>
291 </xsl:template>
293 <xsl:template name="undocumented">
294 <xsl:if test="not(documentation-string)">
295 <xsl:text>&#160;</xsl:text>
296 <span style="color: red">
297 (undocumented)
298 </span>
299 </xsl:if>
300 </xsl:template>
302 <xsl:template match="variable" mode="symbol-index">
303 <a href="{@id}.html">
304 <tt><xsl:value-of select="@name"/></tt>
305 </a>
306 <xsl:text>, variable</xsl:text>
307 <xsl:call-template name="undocumented"/>
308 <br/>
310 <xsl:document href="{@id}.html"
311 method="html"
312 indent="yes"
313 doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
314 doctype-system="http://www.w3.org/TR/html4/loose.dtd">
315 <html>
316 <head>
317 <title>
318 <xsl:text>Variable </xsl:text>
319 <xsl:value-of select="@name"/>
320 </title>
321 <link rel="stylesheet" type="text/css" href="../doc.css"/>
322 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
323 </head>
324 <body>
325 <xsl:call-template name="page-header"/>
326 <div class="main">
327 <p class="noindent">
328 Package:
329 <a href="{../../@id}.html">
330 <xsl:value-of select="../../@name"/>
331 </a>
332 </p>
333 <xsl:apply-templates select="." mode="page"/>
334 </div>
335 </body>
336 </html>
337 </xsl:document>
338 </xsl:template>
340 <xsl:template match="class" mode="page">
341 <h2>
342 Class <xsl:value-of select="@name"/>
343 </h2>
344 <xsl:choose>
345 <xsl:when test="see-also">
346 <table cellspacing="0" cellpadding="0" width="100%">
347 <tr>
348 <td valign="top" width="60%">
349 <xsl:call-template name="class-left"/>
350 </td>
351 <td valign="top" width="5%">
352 &#160;
353 </td>
354 <td valign="top" width="35%">
355 <xsl:call-template name="main-right"/>
356 </td>
357 </tr>
358 </table>
359 </xsl:when>
360 <xsl:otherwise>
361 <xsl:call-template name="class-left"/>
362 </xsl:otherwise>
363 </xsl:choose>
364 </xsl:template>
366 <xsl:template name="class-left">
367 <h3>Superclasses</h3>
368 <div class="indent">
369 <xsl:for-each select="cpl/superclass">
370 <xsl:call-template name="class-list"/>
371 </xsl:for-each>
372 </div>
373 <h3>Documented Subclasses</h3>
374 <div class="indent">
375 <xsl:choose>
376 <xsl:when test="subclasses/subclass">
377 <xsl:for-each select="subclasses/subclass">
378 <xsl:sort select="@id" data-type="text" order="ascending"/>
379 <xsl:call-template name="class-list"/>
380 </xsl:for-each>
381 </xsl:when>
382 <xsl:otherwise>
383 None
384 </xsl:otherwise>
385 </xsl:choose>
386 </div>
387 <xsl:call-template name="main-left"/>
388 </xsl:template>
390 <xsl:template name="class-list">
391 <xsl:if test="position() != 1">
392 <xsl:text>, </xsl:text>
393 </xsl:if>
394 <xsl:choose>
395 <xsl:when test="@id">
396 <a href="{@id}.html">
397 <tt>
398 <xsl:if test="@status = 'INTERNAL'">
399 <xsl:value-of select="@package"/>
400 <xsl:text>::</xsl:text>
401 </xsl:if>
402 <xsl:value-of select="@name"/>
403 </tt>
404 </a>
405 </xsl:when>
406 <xsl:when test="@status = 'INTERNAL'">
407 <tt style="color: #777777">
408 <xsl:value-of select="@package"/>
409 <xsl:text>::</xsl:text>
410 <xsl:value-of select="@name"/>
411 </tt>
412 </xsl:when>
413 <xsl:otherwise>
414 <tt style="color: #777777">
415 <xsl:value-of select="@package"/>
416 <xsl:text>:</xsl:text>
417 <xsl:value-of select="@name"/>
418 </tt>
419 </xsl:otherwise>
420 </xsl:choose>
421 </xsl:template>
423 <xsl:template match="function" mode="page">
424 <h2>
425 Function
426 <xsl:value-of select="@name"/>
427 </h2>
428 <xsl:choose>
429 <xsl:when test="see-also">
430 <table cellspacing="0" cellpadding="0">
431 <tr>
432 <td valign="top" width="60%">
433 <xsl:call-template name="function-left"/>
434 </td>
435 <td valign="top" width="5%">
436 &#160;
437 </td>
438 <td valign="top" width="35%">
439 <xsl:call-template name="main-right"/>
440 </td>
441 </tr>
442 </table>
443 </xsl:when>
444 <xsl:otherwise>
445 <xsl:call-template name="function-left"/>
446 </xsl:otherwise>
447 </xsl:choose>
448 </xsl:template>
450 <xsl:template name="function-left">
451 <h3>Lambda List</h3>
452 <div class="indent">
453 <xsl:apply-templates select="lambda-list"/>
454 </div>
455 <xsl:apply-templates select="return"/>
456 <xsl:call-template name="main-left"/>
457 </xsl:template>
459 <xsl:template match="macro" mode="page">
460 <h2>
461 Macro
462 <xsl:value-of select="@name"/>
463 </h2>
464 <xsl:apply-templates select="lambda-list"/>
465 <xsl:call-template name="main"/>
466 </xsl:template>
468 <xsl:template match="variable" mode="page">
469 <h2>
470 Variable
471 <xsl:value-of select="@name"/>
472 </h2>
473 <xsl:call-template name="main"/>
474 </xsl:template>
476 <xsl:template match="lambda-list">
477 <tt><xsl:value-of select="../@name"/></tt>
478 <xsl:text> (</xsl:text>
479 <xsl:for-each select="elt">
480 <xsl:if test="position() != 1">
481 <xsl:text>&#160;</xsl:text>
482 </xsl:if>
483 <b><xsl:value-of select="text()"/></b>
484 </xsl:for-each>
485 <xsl:text>)</xsl:text>
486 </xsl:template>
488 <xsl:template mode="about-arguments" match="lambda-list">
489 <div class="def">
490 <a href="{../@id}.html">
491 Function
492 <xsl:value-of select="../@name"/>
493 <xsl:text> (</xsl:text>
494 <xsl:for-each select="elt">
495 <xsl:if test="position() != 1">
496 <xsl:text>&#160;</xsl:text>
497 </xsl:if>
498 <xsl:value-of select="text()"/>
499 </xsl:for-each>
500 <xsl:text>)</xsl:text>
501 </a>
502 </div>
503 </xsl:template>
505 <xsl:template match="documentation-string">
506 <div class="indent">
507 <xsl:apply-templates/>
508 </div>
509 </xsl:template>
511 <xsl:template match="short">
512 <xsl:apply-templates/>
513 </xsl:template>
515 <xsl:template match="em">
517 <xsl:apply-templates/>
518 </i>
519 </xsl:template>
521 <xsl:template match="var">
522 <tt>
523 <xsl:apply-templates/>
524 </tt>
525 </xsl:template>
527 <xsl:template match="code">
528 <tt>
529 <xsl:apply-templates/>
530 </tt>
531 </xsl:template>
533 <xsl:template match="fun">
534 <a href="{@id}.html">
535 <tt>
536 <xsl:apply-templates/>
537 </tt>
538 </a>
539 </xsl:template>
541 <xsl:template match="a">
542 <a href="{@a}">
543 <xsl:apply-templates/>
544 </a>
545 </xsl:template>
547 <xsl:template match="class">
548 <a href="{@id}.html">
549 <tt>
550 <xsl:apply-templates/>
551 </tt>
552 </a>
553 </xsl:template>
555 <xsl:template match="variable">
556 <a href="{@id}.html">
557 <tt>
558 <xsl:apply-templates/>
559 </tt>
560 </a>
561 </xsl:template>
563 <xsl:template match="itemize">
564 <ul>
565 <xsl:apply-templates/>
566 </ul>
567 </xsl:template>
569 <xsl:template match="item">
570 <li>
571 <xsl:apply-templates/>
572 </li>
573 </xsl:template>
575 <xsl:template match="see">
576 <tr>
577 <td>
578 <a href="{@id}.html">
579 <tt>
580 <xsl:apply-templates/>
581 </tt>
582 </a>
583 </td>
584 <xsl:if test="@see">
585 <td>
586 &#160;&#160;&#160;&#160;
588 <xsl:value-of select="@see"/>
589 </i>
590 </td>
591 </xsl:if>
592 </tr>
593 </xsl:template>
595 <xsl:template match="return">
596 <h3>Returns</h3>
597 <div class="indent">
598 <xsl:apply-templates/>
599 </div>
600 </xsl:template>
602 <xsl:template match="implementation-note">
603 <h3>Implementation notes</h3>
604 <xsl:apply-templates/>
605 </xsl:template>
607 <xsl:template match="break">
608 <br/><br/>
609 </xsl:template>
611 <xsl:template match="sections">
612 <xsl:for-each select="section">
613 <h2>
614 <a name="{generate-id()}"/>
615 <xsl:value-of select="@section"/>
616 </h2>
617 <xsl:apply-templates/>
618 </xsl:for-each>
619 </xsl:template>
621 <xsl:template match="section" mode="toc">
622 <a href="#{generate-id()}" style="font-weight: bold">
623 <xsl:value-of select="@section"/>
624 </a>
625 <br/>
626 </xsl:template>
628 <xsl:template match="aboutfun">
629 <xsl:variable name="fun" select="text()"/>
630 <xsl:apply-templates mode="about-arguments"
631 select="//function[@name=$fun]/lambda-list"/>
632 <div style="margin-left: 3em">
633 <xsl:choose>
634 <xsl:when test="//function[@name=$fun]/documentation-string//short">
635 <xsl:for-each select="//function[@name=$fun]">
636 <xsl:apply-templates select="documentation-string//short"/>
637 <xsl:text> </xsl:text>
638 <a href="{@id}.html#details">...</a>
639 </xsl:for-each>
640 </xsl:when>
641 <xsl:otherwise>
642 <xsl:apply-templates
643 select="//function[@name=$fun]/documentation-string"/>
644 </xsl:otherwise>
645 </xsl:choose>
646 </div>
647 <br/>
648 </xsl:template>
650 <xsl:template match="aboutclass">
651 <xsl:variable name="name" select="text()"/>
652 <xsl:for-each select="//class[@name=$name]">
653 <div class="def">
654 <a href="{@id}.html">
655 Class
656 <xsl:value-of select="@name"/>
657 </a>
658 </div>
659 </xsl:for-each>
660 <div style="margin-left: 3em">
661 <xsl:choose>
662 <xsl:when test="//class[@name=$name]/documentation-string//short">
663 <xsl:for-each select="//class[@name=$name]">
664 <xsl:apply-templates select="documentation-string//short"/>
665 <xsl:text> </xsl:text>
666 <a href="{@id}.html#details">...</a>
667 </xsl:for-each>
668 </xsl:when>
669 <xsl:otherwise>
670 <xsl:apply-templates
671 select="//class[@name=$name]/documentation-string"/>
672 </xsl:otherwise>
673 </xsl:choose>
674 </div>
675 <br/>
676 </xsl:template>
678 <xsl:template name="page-header">
679 <xsl:call-template name="header">
680 <xsl:with-param name="base" select="'../'"/>
681 </xsl:call-template>
682 </xsl:template>
684 <xsl:template name="header">
685 <xsl:param name="base"/>
686 <div id="header">
687 <table cellspacing="0" cellpadding="0" width="100%">
688 <tr>
689 <td width="176">
690 <a id="headerlink" href="{$base}../index.html">
691 <img src="{$base}logo.png" border="0"/>
692 </a>
693 </td>
694 <td valign="center">
695 &#x2014;
696 <b> Relax NG for Closure XML</b>
697 </td>
698 <td valign="center" align="right">
699 <b>API documentation</b>
700 </td>
701 </tr>
702 </table>
703 </div>
704 </xsl:template>
705 </xsl:stylesheet>