root/tags/lgt291/xml/ie50.xsl

Revision 7, 5.4 KB (checked in by pmoura, 7 years ago)

Corrected compiler bug in the error checking code of directives info/1 and info/2.
Change the "mi" example objects loading order to avoid some "unknown entity" warnings.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0"?>
2<xsl:stylesheet
3    version="1.0"
4    xmlns:xsl="http://www.w3.org/TR/WD-xsl">
5
6
7<!--
8%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9%
10%  Logtalk - Object oriented extension to Prolog
11%  Release 2.9.1
12%
13%  Copyright (c) 1998-2001 Paulo Moura.  All Rights Reserved.
14%
15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16-->
17
18
19<xsl:template match="/">
20    <html>
21    <head>
22        <title><xsl:value-of select="logtalk/entity/name" /></title>
23        <link rel="stylesheet" href="logtalk.css" type="text/css" />
24    </head>
25    <body>
26        <hr />
27        <h4 class="type"><xsl:value-of select="logtalk/entity/type" /></h4>
28        <h1 class="code"><xsl:value-of select="logtalk/entity/name" /></h1>
29        <xsl:apply-templates select="logtalk/entity" />
30        <hr />
31        <xsl:apply-templates select="logtalk/relations" />
32        <hr />
33        <xsl:apply-templates select="logtalk/predicates" />
34        <hr />
35    </body>
36    </html>
37</xsl:template>
38
39
40<xsl:template match="logtalk/entity">
41    <xsl:if test="comment">
42        <blockquote><xsl:value-of select="comment" /></blockquote>
43    </xsl:if>
44    <dl>
45    <xsl:if test="authors">
46        <dt>authors:</dt>
47            <dd><code><xsl:value-of select="authors" /></code></dd>
48    </xsl:if>
49    <xsl:if test="version">
50        <dt>version:</dt>
51            <dd><code><xsl:value-of select="version" /></code></dd>
52    </xsl:if>
53    <xsl:if test="date">
54        <dt>date:</dt>
55            <dd><code><xsl:value-of select="date" /></code></dd>
56    </xsl:if>
57    </dl>
58    <dl>
59        <dt>compilation:</dt>
60            <dd><code><xsl:value-of select="compilation" /></code></dd>
61    </dl>
62    <dl>
63    <xsl:for-each select="info">
64        <dt><xsl:value-of select="key" />:</dt>
65            <dd><code><xsl:value-of select="value" /></code></dd>
66    </xsl:for-each>
67    </dl>
68</xsl:template>
69
70
71<xsl:template match="logtalk/relations">
72    <xsl:choose>
73        <xsl:when test="*">
74            <xsl:if test="implements">
75            <dl>
76            <dt>implements:</dt>
77                <xsl:apply-templates select="implements" />
78            </dl>
79            </xsl:if>
80            <xsl:if test="imports">
81            <dl>
82            <dt>imports:</dt>
83                <xsl:apply-templates select="imports" />
84            </dl>
85            </xsl:if>
86            <xsl:if test="extends">
87            <dl>
88            <dt>extends:</dt>
89                <xsl:apply-templates select="extends" />
90            </dl>
91            </xsl:if>
92            <xsl:if test="instantiates">
93            <dl>
94            <dt>instantiates:</dt>
95                <xsl:apply-templates select="instantiates" />
96            </dl>
97            </xsl:if>
98            <xsl:if test="specializes">
99            <dl>
100            <dt>specializes:</dt>
101                <xsl:apply-templates select="specializes" />
102            </dl>
103            </xsl:if>
104            <xsl:if test="uses">
105            <dl>
106            <dt>uses:</dt>
107                <xsl:apply-templates select="uses" />
108            </dl>
109            </xsl:if>
110            <xsl:if test="calls">
111            <dl>
112            <dt>calls:</dt>
113                <xsl:apply-templates select="calls" />
114            </dl>
115            </xsl:if>
116        </xsl:when>
117        <xsl:otherwise> 
118            <h4 class="code">(no dependencies on other files)</h4>
119        </xsl:otherwise>
120    </xsl:choose>
121</xsl:template>
122
123
124<xsl:template match="logtalk/relations/uses">
125    <dd><code><a><xsl:attribute name="href"><xsl:value-of select="file" />.xml</xsl:attribute><xsl:value-of select="name" /></a></code></dd>
126</xsl:template>
127
128
129<xsl:template match="logtalk/relations/calls">
130    <dd><code><a><xsl:attribute name="href"><xsl:value-of select="file" />.xml</xsl:attribute><xsl:value-of select="name" /></a></code></dd>
131</xsl:template>
132
133
134<xsl:template match="logtalk/relations/*" xml:space="preserve">
135    <dd><code><xsl:value-of select="scope" /> <a><xsl:attribute name="href"><xsl:value-of select="file" />.xml</xsl:attribute><xsl:value-of select="name" /></a></code></dd>
136</xsl:template>
137
138
139<xsl:template match="logtalk/predicates">
140    <h1>Public interface</h1>
141    <xsl:choose>
142        <xsl:when test="public/predicate">
143            <xsl:apply-templates select="public/predicate" />
144        </xsl:when>
145        <xsl:when test="/logtalk/relations/*">     
146            <h4 class="code">(see related entities)</h4>
147        </xsl:when>
148        <xsl:otherwise>
149            <h4 class="code">(none)</h4>
150        </xsl:otherwise>
151    </xsl:choose>
152    <h1>Protected interface</h1>
153    <xsl:choose>
154        <xsl:when test="protected/predicate">
155            <xsl:apply-templates select="protected/predicate" />
156        </xsl:when>
157        <xsl:when test="/logtalk/relations/*">     
158            <h4 class="code">(see related entities)</h4>
159        </xsl:when>
160        <xsl:otherwise>
161            <h4 class="code">(none)</h4>
162        </xsl:otherwise>
163    </xsl:choose>
164    <h1>Private predicates</h1>
165    <xsl:choose>
166        <xsl:when test="private/predicate">
167            <xsl:apply-templates select="private/predicate" />
168        </xsl:when>
169        <xsl:when test="/logtalk/relations/*">     
170            <h4 class="code">(see related entities)</h4>
171        </xsl:when>
172        <xsl:otherwise>
173            <h4 class="code">(none)</h4>
174        </xsl:otherwise>
175    </xsl:choose>
176</xsl:template>
177
178
179<xsl:template match="predicate">
180    <h4 class="code"><xsl:value-of select="name" /></h4>
181    <xsl:if test="comment">
182        <blockquote><xsl:value-of select="comment" /></blockquote>
183    </xsl:if>
184    <dl class="predicate">
185        <dt>compilation:</dt>
186            <dd><code><xsl:value-of select="compilation" /></code></dd>
187        <xsl:if test="template">
188        <dt>template:</dt>
189            <dd><code><xsl:value-of select="template" /></code></dd>
190        </xsl:if>
191        <xsl:if test="meta">
192        <dt>metapredicate template:</dt>
193            <dd><code><xsl:value-of select="meta" /></code></dd>
194        </xsl:if>
195        <xsl:if test="mode">
196        <dt>mode - number of solutions:</dt>
197        <xsl:for-each select="mode" xml:space="preserve">
198            <dd><code><xsl:value-of select="template" /> - <xsl:value-of select="solutions" /></code></dd>
199        </xsl:for-each>
200        </xsl:if>
201    </dl>
202    <dl class="predicate">
203        <xsl:for-each select="info">
204        <dt><xsl:value-of select="key" />:</dt>
205            <dd><code><xsl:value-of select="value" /></code></dd>
206        </xsl:for-each>
207    </dl>
208</xsl:template>
209
210
211</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.