comparison src/de/mpiwg/itgroup/escidoc/MPIWGServices/Restlet/staticPages/formatIndexMeta.xsl @ 0:1aac45997235

first ingest
author dwinter
date Wed, 01 Dec 2010 17:35:51 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1aac45997235
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- based on Resurce2Html.xsl, copyright by Max Planck Digital Library -->
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:prop="http://escidoc.de/core/01/properties/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4 version="1.0" xmlns:xlink="http://www.w3.org/1999/xlink">
5 <xsl:output encoding="iso-8859-1" indent="yes" method="html" />
6
7 <!-- display serialized java.util.Properties nicely -->
8 <xsl:template match="/properties">
9 <xsl:for-each select="entry">
10 <ul>
11 <b>
12 <xsl:value-of select="@key" />
13 :
14 </b>
15 <xsl:value-of select="./text()" />
16 </ul>
17 </xsl:for-each>
18 </xsl:template>
19
20 <xsl:template match="/">
21 <html>
22 <head>
23 <title>eSciDoc<xsl:if test="*/@xlink:title != ''"> - <xsl:value-of select="*/@xlink:title"/></xsl:if><xsl:if test="*/@xlink:href"> - <xsl:value-of select="*/@xlink:href"/></xsl:if></title>
24
25 </head>
26 <body bgcolor="#eeeeee">
27 <img src="http://www.mpiwg-berlin.mpg.de/en/images/logo.png" />
28 <br />
29 <!--
30 <xsl:choose>
31 <xsl:when test="item-list-refs">
32 <xsl:for-each select="item-list-refs">
33 <xsl:call-template name="item-list-refs" />
34 </xsl:for-each>
35 </xsl:when>
36 <xsl:otherwise>
37 <xsl:apply-templates />
38 </xsl:otherwise>
39 </xsl:choose>
40 -->
41 <xsl:apply-templates/>
42 </body>
43 </html>
44 </xsl:template>
45 <xsl:template match="item-ref-list|item-list-refs">
46 <xsl:variable name="theBase">
47 <xsl:value-of select="@xml:base" />
48 </xsl:variable>
49 <h2>
50 <xsl:value-of select="@xlink:title" />
51 </h2>
52 <xsl:for-each select="*">
53 <li>
54 <a>
55 <xsl:attribute name="href">
56 <xsl:value-of select="$theBase" />
57 <xsl:value-of select="@xlink:href" />
58 </xsl:attribute>
59 <xsl:value-of select="@objid" />
60 </a>
61 </li>
62 </xsl:for-each>
63 </xsl:template>
64 <xsl:template match="exception">
65 <h1><xsl:value-of select="title"/></h1>
66 <blockquote>
67 <P><xsl:value-of select="class"/></P>
68 <xsl:variable name="UID">message<xsl:value-of select="count(ancestor::*)"/></xsl:variable>
69 <P>
70 <xsl:attribute name="onClick">toggleVisibility('<xsl:value-of select="$UID"/>');</xsl:attribute>
71 <xsl:attribute name="id">
72 <xsl:value-of select="$UID"/>
73 </xsl:attribute>
74 <xsl:attribute name="style">border: 0px solid #000000;</xsl:attribute>
75 <font style="color: #0000ff;">Message</font>
76 </P>
77 <pre style="display: none; visibility: hidden;">
78 <xsl:attribute name="id"><xsl:value-of select="$UID"/>-body</xsl:attribute>
79 <xsl:value-of select="message"/>
80 </pre>
81
82 <xsl:variable name="UID2">stacktrace<xsl:value-of select="count(ancestor::*)"/></xsl:variable>
83 <P>
84 <xsl:attribute name="onClick">toggleVisibility('<xsl:value-of select="$UID2"/>');</xsl:attribute>
85 <xsl:attribute name="id">
86 <xsl:value-of select="$UID2"/>
87 </xsl:attribute>
88 <xsl:attribute name="style">border: 0px solid #000000;</xsl:attribute>
89 <font style="color: #0000ff;">Stack Trace</font>
90 </P>
91 <pre style="display: none; visibility: hidden;">
92 <xsl:attribute name="id"><xsl:value-of select="$UID2"/>-body</xsl:attribute>
93 <xsl:value-of select="stack-trace"/>
94 </pre>
95
96 <xsl:variable name="UID3">more<xsl:value-of select="count(ancestor::*)"/></xsl:variable>
97 <xsl:if test="cause/exception">
98 <P>
99 <xsl:attribute name="onClick">toggleVisibility('<xsl:value-of select="$UID3"/>');</xsl:attribute>
100 <xsl:attribute name="id">
101 <xsl:value-of select="$UID3"/>
102 </xsl:attribute>
103 <xsl:attribute name="style">border: 0px solid #000000;</xsl:attribute>
104 <font style="color: #0000ff;">Nested Exceptions</font>
105 </P>
106 <pre style="display: none; visibility: hidden;">
107 <xsl:attribute name="id"><xsl:value-of select="$UID3"/>-body</xsl:attribute>
108 <xsl:apply-templates select="cause/exception"/>
109 </pre>
110 </xsl:if>
111 </blockquote>
112 </xsl:template>
113
114 <!--
115 <xsl:template match="rdf:RDF">
116 <h3>From RDF representation:</h3>
117 <ul>
118 <xsl:apply-templates/>
119 </ul>
120 </xsl:template>
121 <xsl:template match="rdf:Description">
122 <li><a><xsl:attribute name="href">/ir/item/<xsl:value-of select="substring-after(@rdf:about, '/')"/></xsl:attribute><xsl:value-of select="*[local-name() = 'title']"/></a>
123 <ul>
124 <li>created by<xsl:text> </xsl:text><b><xsl:value-of select="*[local-name() = 'created-by-title']"/></b></li>
125 <li>status is<xsl:text> </xsl:text><b><xsl:value-of select="*[local-name() = 'latest-version-status']"/></b>
126 <xsl:if test="*[local-name() = 'public-status' and text() = 'released']">
127 and is <b>public available</b>
128 </xsl:if>
129 </li>
130 <li>known PIDs:
131 <xsl:for-each select="*[local-name() = 'identifier']">
132 &#160;&#160;&#160;<b><xsl:value-of select="."/></b>
133 </xsl:for-each>
134 </li>
135 </ul>
136 </li>
137 </xsl:template>
138 -->
139
140 <xsl:template match="identifier">
141 </xsl:template>
142
143 <xsl:template match="*">
144 <xsl:variable name="theBase">
145 <xsl:value-of select="@xml:base" />
146 </xsl:variable>
147 <!-- Base-URL is <xsl:value-of select="$theBase"/> -->
148 <h3>
149 <xsl:value-of select="@xlink:title" />
150 (
151 <xsl:value-of select="local-name()" />
152 <xsl:choose>
153 <xsl:when test="@objid">
154 -
155 <xsl:value-of select="@objid" />
156 </xsl:when>
157 <xsl:when test="@name">
158 -
159 <xsl:value-of select="@name" />
160 </xsl:when>
161 <xsl:when test="@id">
162 -
163 <xsl:value-of select="@id" />
164 </xsl:when>
165 </xsl:choose>
166 )
167 </h3>
168 <xsl:if test="./*/*[local-name() = 'version']">
169 <p>
170 This version:
171 <a>
172 <xsl:attribute name="href">
173 <xsl:value-of select="$theBase" />
174 <xsl:value-of
175 select="./*/*[local-name() = 'version']/@xlink:href" />
176 </xsl:attribute>
177 <xsl:value-of
178 select="./*/*[local-name() = 'version']/@xlink:href" />
179 </a>
180 (
181 <xsl:value-of
182 select="./*/*[local-name() = 'version']/*[local-name() = 'date']" />
183 )
184 <xsl:if test="./*/*[local-name() = 'latest-version']">
185 <br />
186 Latest version:
187 <a>
188 <xsl:attribute name="href">
189 <xsl:value-of select="$theBase" />
190 <xsl:value-of
191 select="./*/*[local-name() = 'latest-version']/@xlink:href" />
192 </xsl:attribute>
193 <xsl:value-of
194 select="./*/*[local-name() = 'latest-version']/@xlink:href" />
195 </a>
196 (
197 <xsl:value-of
198 select="./*/*[local-name() = 'latest-version']/*[local-name() = 'date']" />
199 )
200 </xsl:if>
201 <xsl:if test="./*/*[local-name() = 'latest-release']">
202 <br />
203 Latest release:
204 <a>
205 <xsl:attribute name="href">
206 <xsl:value-of select="$theBase" />
207 <xsl:value-of
208 select="./*/*[local-name() = 'latest-release']/@xlink:href" />
209 </xsl:attribute>
210 <xsl:value-of
211 select="./*/*[local-name() = 'latest-release']/@xlink:href" />
212 </a>
213 (
214 <xsl:value-of
215 select="./*/*[local-name() = 'latest-release']/*[local-name() = 'date']" />
216 )
217 </xsl:if>
218 </p>
219 </xsl:if>
220 <ul>
221 <xsl:for-each select="./*[@xlink:href]">
222 <xsl:variable name="contentLink" select="@xlink:href"/>
223 <li>
224 <a>
225 <xsl:attribute name="href">
226 <xsl:if test="not(starts-with(@xlink:href, 'http'))">
227 <xsl:value-of select="$theBase" />
228 </xsl:if>
229 <xsl:value-of select="@xlink:href" />
230 </xsl:attribute>
231 <xsl:value-of select="local-name()" />
232 </a>
233 <xsl:if test="@predicate">
234 - <xsl:value-of select="@predicate"/>
235 </xsl:if>
236 <xsl:choose>
237 <xsl:when test="@xlink:title">
238 -
239 <xsl:value-of select="@xlink:title" />
240 </xsl:when>
241 <xsl:when test="@objid">
242 -
243 <xsl:value-of select="@objid" />
244 </xsl:when>
245 <xsl:when test="@name">
246 -
247 <xsl:value-of select="@name" />
248 </xsl:when>
249 <xsl:when test="@id">
250 -
251 <xsl:value-of select="@id" />
252 </xsl:when>
253 </xsl:choose>
254 <!-- xsl:if test="local-name()='content'" -->
255 <xsl:if test="@storage = 'internal-managed'">
256 <xsl:variable name = "mimeType" select="//prop:mime-type"/>
257 <xsl:if test="starts-with($mimeType, 'image')">
258 <br /> ( Image service:
259 <a>
260 <xsl:attribute name="href">
261 <xsl:value-of select="$theBase" />
262 <xsl:value-of select="$contentLink" />
263 /digilib/digimage
264 </xsl:attribute>
265 digimage
266 </a>)
267 </xsl:if>
268 </xsl:if>
269 <xsl:if
270 test="local-name() = 'current-version' or local-name() = 'version'">
271 <xsl:for-each select="./*">
272 <xsl:call-template name="keynval" />
273 </xsl:for-each>
274 </xsl:if>
275 </li>
276 </xsl:for-each>
277 </ul>
278 <xsl:for-each select="./*[not(@xlink:href)]">
279 <xsl:call-template name="keynval" />
280 </xsl:for-each>
281 </xsl:template>
282
283 <!--
284 <xsl:template match="mdr:md-record">
285 <h3><xsl:value-of select="@xlink:title"/> (<xsl:value-of select="local-name()"/>
286 <xsl:choose>
287 <xsl:when test="@objid"> - <xsl:value-of select="@objid"/></xsl:when>
288 <xsl:when test="@name"> - <xsl:value-of select="@name"/></xsl:when>
289 <xsl:when test="@id"> - <xsl:value-of select="@id"/></xsl:when>
290 </xsl:choose>)</h3>
291 <xsl:call-template name="keynval"/>
292 </xsl:template>
293 -->
294
295 <xsl:template name="keynval">
296 <ul>
297 <b>
298 <xsl:value-of select="local-name()" />
299 :
300 </b>
301 <xsl:choose>
302 <xsl:when test="@xlink:href">
303 <a>
304 <xsl:attribute name="href">
305 <xsl:value-of select="@xlink:href" />
306 </xsl:attribute>
307 <xsl:value-of select="@xlink:href" />
308 </a>
309 </xsl:when>
310 <xsl:otherwise>
311 <xsl:value-of select="./text()" />
312 <xsl:for-each select="@*">
313 <xsl:text> @</xsl:text>
314 <b><xsl:value-of select="local-name()"/></b>
315 <xsl:text>=</xsl:text>
316 <xsl:value-of select="."/>
317 </xsl:for-each>
318 </xsl:otherwise>
319 </xsl:choose>
320 <br />
321 <xsl:for-each select="./*">
322 <xsl:call-template name="keynval" />
323 </xsl:for-each>
324 </ul>
325 </xsl:template>
326
327 <!--
328 <xsl:template match="*">
329 <xsl:param name="theBase"/>
330 <xsl:value-of select="local-name()"/>: <a>
331 <xsl:attribute name="href">
332 <xsl:value-of select="$theBase"/>
333 <xsl:value-of select="@xlink:href"/>
334 </xsl:attribute> link </a><br/>
335 </xsl:template>
336 -->
337
338 </xsl:stylesheet>