]> matita.cs.unibo.it Git - helm.git/blob - helm/style/show_dc.xsl
Initial revision
[helm.git] / helm / style / show_dc.xsl
1 <?xml version="1.0"?>
2
3 <!-- Copyright (C) 2000, HELM Team                                     -->
4 <!--                                                                   -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic            -->
6 <!-- Library of Mathematics, developed at the Computer Science         -->
7 <!-- Department, University of Bologna, Italy.                         -->
8 <!--                                                                   -->
9 <!-- HELM is free software; you can redistribute it and/or             -->
10 <!-- modify it under the terms of the GNU General Public License       -->
11 <!-- as published by the Free Software Foundation; either version 2    -->
12 <!-- of the License, or (at your option) any later version.            -->
13 <!--                                                                   -->
14 <!-- HELM is distributed in the hope that it will be useful,           -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
17 <!-- GNU General Public License for more details.                      -->
18 <!--                                                                   -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software               -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
22 <!-- MA  02111-1307, USA.                                              -->
23 <!--                                                                   -->
24 <!-- For details, see the HELM World-Wide-Web page,                    -->
25 <!-- http://cs.unibo.it/helm/.                                         -->
26
27 <xsl:stylesheet version="1.0"
28                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
29                 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
30                 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
31                 xmlns:dc="http://purl.org/metadata/dublin_core#"
32                 xmlns:dcq="http://purl.org/metadata/dublin_core_qualifiers#"
33                 xmlns:h="http:/www.cs.unibo.it/helm/schemas/schema-h.rdf#"
34                 xmlns:hth="http://www.cs.unibo.it/helm/schemas/schema-hth.rdf#">
35
36 <xsl:output 
37         method="xml" 
38         encoding="iso-8859-1" 
39         media-type="text/html"
40         doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
41         doctype-system="DTD/xhtml1-transitional.dtd" />
42
43 <xsl:template name="loop_show_dc">
44  <xsl:param name="CICURI" select="''"/>
45  <xsl:param name="first_time" select="true()"/>
46  <xsl:variable name="document" select="document(concat($BaseRDFURLDC,$CICURI))"/>
47  <xsl:choose>
48   <xsl:when test="$document/rdf:RDF/*/*">
49    <h1>Dublin Core Metadata for <xsl:value-of select="$CICURI"/>:</h1>
50    <xsl:apply-templates mode="show_dc" select="$document">
51     <xsl:with-param name="CICURI" select="$CICURI"/>
52    </xsl:apply-templates>
53   </xsl:when>
54   <xsl:otherwise>
55    <xsl:if test="$first_time">
56     <h1>No Dublin Core Metadata available for <xsl:value-of select="$CICURI"/>.</h1>
57    </xsl:if>
58   </xsl:otherwise>
59  </xsl:choose>
60  <xsl:variable name="basename">
61   <xsl:call-template name="get_basename">
62    <xsl:with-param name="CICURI" select="$CICURI"/>
63   </xsl:call-template>
64  </xsl:variable>
65  <xsl:variable name="parentURI" select="substring-before($CICURI,concat('/',$basename))"/>
66  <xsl:if test="not($parentURI = 'cic:')">
67   <xsl:call-template name="loop_show_dc">
68    <xsl:with-param name="CICURI" select="$parentURI"/>
69    <xsl:with-param name="first_time" select="false()"/>
70   </xsl:call-template>
71  </xsl:if>
72 </xsl:template>
73
74 <xsl:template name="get_basename">
75  <xsl:param name="CICURI"/>
76  <xsl:variable name="suffix" select="substring-after($CICURI,'/')"/>
77  <xsl:choose>
78   <xsl:when test="$suffix = ''">
79    <xsl:value-of select="$CICURI"/>
80   </xsl:when>
81   <xsl:otherwise>
82    <xsl:call-template name="get_basename">
83     <xsl:with-param name="CICURI" select="$suffix"/>
84    </xsl:call-template>
85   </xsl:otherwise>
86  </xsl:choose>
87 </xsl:template>
88
89 <xsl:template mode="show_dc" match="/">
90  <table>
91   <xsl:apply-templates mode="show_dc" select="rdf:RDF/*/*"/>
92  </table>
93 </xsl:template>
94
95 <xsl:template mode="show_dc" match="dc:title">
96  <tr>
97   <td>Title:</td>
98   <td><xsl:apply-templates mode="show_dc"/></td>
99  </tr>
100 </xsl:template>
101
102 <xsl:template mode="show_dc" match="dc:creator">
103  <tr>
104   <td>Creator:</td>
105   <td><xsl:apply-templates mode="show_dc"/></td>
106  </tr>
107 </xsl:template>
108
109 <xsl:template mode="show_dc" match="dc:contributor">
110  <tr>
111   <td>Contributor:</td>
112   <td><xsl:apply-templates mode="show_dc"/></td>
113  </tr>
114 </xsl:template>
115
116 <xsl:template mode="show_dc" match="dc:subject">
117  <tr>
118   <td>Subject:</td>
119   <td><xsl:apply-templates mode="show_dc"/></td>
120  </tr>
121 </xsl:template>
122
123 <xsl:template mode="show_dc" match="dc:description">
124  <tr>
125   <td>Description:</td>
126   <td><xsl:apply-templates mode="show_dc"/></td>
127  </tr>
128 </xsl:template>
129
130 <xsl:template mode="show_dc" match="dc:publisher">
131  <tr>
132   <td>Publisher:</td>
133   <td><xsl:apply-templates mode="show_dc"/></td>
134  </tr>
135 </xsl:template>
136
137 <xsl:template mode="show_dc" match="dc:date">
138  <tr>
139   <td>Date:</td>
140   <td><xsl:apply-templates mode="show_dc"/></td>
141  </tr>
142 </xsl:template>
143
144 <xsl:template mode="show_dc" match="dc:coverage">
145  <tr>
146   <td>Coverage:</td>
147   <td><xsl:apply-templates mode="show_dc"/></td>
148  </tr>
149 </xsl:template>
150
151 <xsl:template mode="show_dc" match="dc:type">
152  <tr>
153   <td>Type:</td>
154   <td><xsl:apply-templates mode="show_dc"/></td>
155  </tr>
156 </xsl:template>
157
158 <xsl:template mode="show_dc" match="hth:ResourceType">
159  <xsl:value-of select="substring-after(@rdf:about,'#')"/>
160 </xsl:template>
161
162 <xsl:template mode="show_dc" match="dc:format">
163  <tr>
164   <td>Format:</td>
165   <td><xsl:apply-templates mode="show_dc"/></td>
166  </tr>
167 </xsl:template>
168
169 <xsl:template mode="show_dc" match="hth:ResourceFormat">
170  <xsl:value-of select="substring-after(@rdf:about,'#')"/>
171 </xsl:template>
172
173 <xsl:template mode="show_dc" match="dc:identifier">
174  <tr>
175   <td>Identifier:</td>
176   <td><xsl:apply-templates mode="show_dc"/></td>
177  </tr>
178 </xsl:template>
179
180 <xsl:template mode="show_dc" match="dc:source">
181  <tr>
182   <td>Source:</td>
183   <td><xsl:apply-templates mode="show_dc"/></td>
184  </tr>
185 </xsl:template>
186
187 <xsl:template mode="show_dc" match="dc:language">
188  <tr>
189   <td>Language:</td>
190   <td><xsl:apply-templates mode="show_dc"/></td>
191  </tr>
192 </xsl:template>
193
194 <xsl:template mode="show_dc" match="dc:relation">
195  <tr>
196   <td>Relation:</td>
197   <td><xsl:apply-templates mode="show_dc"/></td>
198  </tr>
199 </xsl:template>
200
201 <xsl:template mode="show_dc" match="dcq:RelationType">
202  <xsl:value-of select="substring-after(@rdf:about,'#')"/>
203  <xsl:text> </xsl:text>
204  <xsl:value-of select="@rdf:value"/>
205 </xsl:template>
206
207 <xsl:template mode="show_dc" match="dc:rights">
208  <tr>
209   <td>Rights:</td>
210   <td><xsl:apply-templates mode="show_dc"/></td>
211  </tr>
212 </xsl:template>
213
214 <xsl:template mode="show_dc" match="hth:institution">
215  <tr>
216   <td>Institution:</td>
217   <td><xsl:apply-templates mode="show_dc"/></td>
218  </tr>
219 </xsl:template>
220
221 <xsl:template mode="show_dc" match="hth:contact">
222  <tr>
223   <td>Contact:</td>
224   <td><xsl:apply-templates mode="show_dc"/></td>
225  </tr>
226 </xsl:template>
227
228 <xsl:template mode="show_dc" match="hth:firstVersion">
229  <tr>
230   <td>First Version:</td>
231   <td><xsl:apply-templates mode="show_dc"/></td>
232  </tr>
233 </xsl:template>
234
235 <xsl:template mode="show_dc" match="hth:modified">
236  <tr>
237   <td>Modified:</td>
238   <td><xsl:apply-templates mode="show_dc"/></td>
239  </tr>
240 </xsl:template>
241
242 <xsl:template mode="show_dc" match="*">
243  <tr>
244   <td>ERROR!</td>
245   <td><xsl:value-of select="name(.)"/></td>
246  </tr>
247 </xsl:template>
248
249 </xsl:stylesheet>