root/trunk/xml/ie50.xsl

Revision 4662, 5.8 KB (checked in by pmoura, 5 days ago)

Updated copyright notice.

  • 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================================================================
9Logtalk - Open source object-oriented logic programming language
10Release 2.35.0
11
12Copyright (c) 1998-2009 Paulo Moura.        All Rights Reserved.
13Logtalk is free software.  You can redistribute it and/or modify
14it under the terms of the "Artistic License 2.0" as published by
15The Perl Foundation. Consult the "LICENSE.txt" file for details.
16================================================================
17-->
18
19
20<xsl:template match="/">
21    <html>
22    <head>
23        <title><xsl:value-of select="logtalk/entity/name" /></title>
24        <link rel="stylesheet" href="logtalk.css" type="text/css" />
25    </head>
26    <body>
27        <hr />
28        <h4 class="type"><xsl:value-of select="logtalk/entity/type" /></h4>
29        <h1 class="code"><xsl:value-of select="logtalk/entity/name" /></h1>
30        <xsl:apply-templates select="logtalk/entity" />
31        <hr />
32        <xsl:apply-templates select="logtalk/relations" />
33        <hr />
34        <xsl:apply-templates select="logtalk/predicates" />
35        <hr />
36    </body>
37    </html>
38</xsl:template>
39
40
41<xsl:template match="logtalk/entity">
42    <xsl:if test="comment">
43        <blockquote><xsl:value-of select="comment" /></blockquote>
44    </xsl:if>
45    <dl>
46    <xsl:if test="author">
47        <dt>author:</dt>
48            <dd><code><xsl:value-of select="author" /></code></dd>
49    </xsl:if>
50    <xsl:if test="version">
51        <dt>version:</dt>
52            <dd><code><xsl:value-of select="version" /></code></dd>
53    </xsl:if>
54    <xsl:if test="date">
55        <dt>date:</dt>
56            <dd><code><xsl:value-of select="date" /></code></dd>
57    </xsl:if>
58    </dl>
59    <dl>
60        <dt>compilation:</dt>
61            <dd><code><xsl:value-of select="compilation" /></code></dd>
62    </dl>
63    <dl>
64    <xsl:for-each select="info">
65        <dt><xsl:value-of select="key" />:</dt>
66            <dd><code><xsl:value-of select="value" /></code></dd>
67    </xsl:for-each>
68    </dl>
69</xsl:template>
70
71
72<xsl:template match="logtalk/relations">
73    <xsl:choose>
74        <xsl:when test="*">
75            <xsl:if test="implements">
76            <dl>
77            <dt>implements:</dt>
78                <xsl:apply-templates select="implements" />
79            </dl>
80            </xsl:if>
81            <xsl:if test="imports">
82            <dl>
83            <dt>imports:</dt>
84                <xsl:apply-templates select="imports" />
85            </dl>
86            </xsl:if>
87            <xsl:if test="extends">
88            <dl>
89            <dt>extends:</dt>
90                <xsl:apply-templates select="extends" />
91            </dl>
92            </xsl:if>
93            <xsl:if test="instantiates">
94            <dl>
95            <dt>instantiates:</dt>
96                <xsl:apply-templates select="instantiates" />
97            </dl>
98            </xsl:if>
99            <xsl:if test="specializes">
100            <dl>
101            <dt>specializes:</dt>
102                <xsl:apply-templates select="specializes" />
103            </dl>
104            </xsl:if>
105            <xsl:if test="uses">
106            <dl>
107            <dt>uses:</dt>
108                <xsl:apply-templates select="uses" />
109            </dl>
110            </xsl:if>
111            <xsl:if test="calls">
112            <dl>
113            <dt>calls:</dt>
114                <xsl:apply-templates select="calls" />
115            </dl>
116            </xsl:if>
117        </xsl:when>
118        <xsl:otherwise> 
119            <h4 class="code">(no dependencies on other files)</h4>
120        </xsl:otherwise>
121    </xsl:choose>
122</xsl:template>
123
124
125<xsl:template match="logtalk/relations/uses">
126    <dd><code><a><xsl:attribute name="href"><xsl:value-of select="file" />.xml</xsl:attribute><xsl:value-of select="name" /></a></code></dd>
127</xsl:template>
128
129
130<xsl:template match="logtalk/relations/calls">
131    <dd><code><a><xsl:attribute name="href"><xsl:value-of select="file" />.xml</xsl:attribute><xsl:value-of select="name" /></a></code></dd>
132</xsl:template>
133
134
135<xsl:template match="logtalk/relations/*" xml:space="preserve">
136    <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>
137</xsl:template>
138
139
140<xsl:template match="logtalk/predicates">
141    <h1>Public interface</h1>
142    <xsl:choose>
143        <xsl:when test="public/predicate">
144            <xsl:apply-templates select="public/predicate" />
145        </xsl:when>
146        <xsl:when test="/logtalk/relations/*">     
147            <h4 class="code">(see related entities)</h4>
148        </xsl:when>
149        <xsl:otherwise>
150            <h4 class="code">(none)</h4>
151        </xsl:otherwise>
152    </xsl:choose>
153    <h1>Protected interface</h1>
154    <xsl:choose>
155        <xsl:when test="protected/predicate">
156            <xsl:apply-templates select="protected/predicate" />
157        </xsl:when>
158        <xsl:when test="/logtalk/relations/*">     
159            <h4 class="code">(see related entities)</h4>
160        </xsl:when>
161        <xsl:otherwise>
162            <h4 class="code">(none)</h4>
163        </xsl:otherwise>
164    </xsl:choose>
165    <h1>Private predicates</h1>
166    <xsl:choose>
167        <xsl:when test="private/predicate">
168            <xsl:apply-templates select="private/predicate" />
169        </xsl:when>
170        <xsl:when test="/logtalk/relations/*">     
171            <h4 class="code">(see related entities)</h4>
172        </xsl:when>
173        <xsl:otherwise>
174            <h4 class="code">(none)</h4>
175        </xsl:otherwise>
176    </xsl:choose>
177</xsl:template>
178
179
180<xsl:template match="predicate">
181    <h4 class="code"><xsl:value-of select="name" /></h4>
182    <xsl:if test="comment">
183        <blockquote><xsl:value-of select="comment" /></blockquote>
184    </xsl:if>
185    <dl class="predicate">
186        <dt>compilation:</dt>
187            <dd><code><xsl:value-of select="compilation" /></code></dd>
188        <xsl:if test="template">
189        <dt>template:</dt>
190            <dd><code><xsl:value-of select="template" /></code></dd>
191        </xsl:if>
192        <xsl:if test="meta">
193        <dt>meta-predicate template:</dt>
194            <dd><code><xsl:value-of select="meta" /></code></dd>
195        </xsl:if>
196        <xsl:if test="mode">
197        <dt>mode - number of solutions:</dt>
198        <xsl:for-each select="mode" xml:space="preserve">
199            <dd><code><xsl:value-of select="template" /> - <xsl:value-of select="solutions" /></code></dd>
200        </xsl:for-each>
201        </xsl:if>
202        <xsl:if test="exceptions">
203        <dt>exceptions:</dt>
204        <xsl:for-each select="exceptions/exception">
205            <dd><xsl:value-of select="condition" />: <code><xsl:value-of select="term" /></code></dd>
206        </xsl:for-each>
207        </xsl:if>
208    </dl>
209    <dl class="predicate">
210        <xsl:for-each select="info">
211        <dt><xsl:value-of select="key" />:</dt>
212            <dd><code><xsl:value-of select="value" /></code></dd>
213        </xsl:for-each>
214    </dl>
215</xsl:template>
216
217
218</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.