source: MDService2/trunk/MDService2/src/xsl/complist2view.xsl

Last change on this file was 742, checked in by vronk, 14 years ago

started IE-browser fixes

File size: 2.9 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--     
4    $Date: 2010-05-09 $
5   
6    created based on comp2view.xsl vronk
7
8<sample>
9        <componentDescription>
10                <id>clarin.eu:cr1:c_1272022528362</id>
11                <description>Type of data collection</description>
12                <name>Datacollection</name>
13                <registrationDate>04/26/2010 12:12:52 CEST</registrationDate>
14                <creatorName>Folkert de Vriend</creatorName>
15                −
16                <ns2:href>
17                http://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/components/clarin.eu:cr1:c_1272022528362
18                </ns2:href>
19                <groupName>CLARIN-Nl</groupName>
20        </componentDescription>
21</sample>
22-->
23
24<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
25    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dcr="http://www.isocat.org"
26    xmlns:my="myFunctions" >
27    <xsl:strip-space elements="*"/>
28    <xsl:include href="cmd_commons.xsl"/>
29
30    <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
31
32        <xsl:param name="title" 
33                select="concat('Component view: ', if(/CMD_ComponentSpec/Header/Name/text()) then /CMD_ComponentSpec/Header/Name/text() else /CMD_ComponentSpec/CMD_Component[1]/@name)" />                             
34                       
35           
36    <!-- main -->
37    <!-- <xsl:template match="/"> -->
38    <xsl:template name="continue-root"> 
39       
40          <!-- Process the complete tree -->                   
41             
42                                <xsl:choose>
43                        <xsl:when test="$format='complist2htmldetail'" >
44                              <div id="complist">
45                                        <table class="show">
46                                                <caption>Profiles in Component Registry</caption>
47                                                <thead>
48                                                        <tr><th>name id</th><th>date author</th><th>description</th></tr>
49                                                </thead>
50                                                        <xsl:apply-templates select="/*/*" mode="detail" />
51                                                </table>
52                                </div>
53                                </xsl:when>                             
54                        <xsl:when test="$format='complist2htmlselect'" >                                                     
55                                        <select id="profile-select" class="cmds-ui-elem-stretch">               
56                                                        <xsl:apply-templates select="/*/*" mode="select"/>                                                     
57                                                </select>                                                               
58                        </xsl:when>
59                        <xsl:otherwise>
60                                        <div id="complist">
61                                        <ul>           
62                                                        <xsl:apply-templates select="/*/*" />
63                                                </ul>
64                                        </div>   
65                        </xsl:otherwise>
66         </xsl:choose>
67                       
68    </xsl:template>
69   
70    <!-- generate actual HTML(?)-view -->
71  <xsl:template match="/*/*">
72                <li><span><a href="{my:rewriteURL(id)}" ><xsl:value-of select="name" /></a></span></li>                 
73        </xsl:template>
74
75  <xsl:template match="/*/*" mode="detail">
76        <!--  concat($detail_complist_prefix, my:extractID(id)) -->
77                <tr><td><b><a href="{my:rewriteURL(id)}" ><xsl:value-of select="name" /></a></b></td>
78                        <td><xsl:value-of select="substring(registrationDate,1,10)" /><br/>
79                        <xsl:value-of select="creatorName" />
80                        </td>
81                        <td><xsl:value-of select="description" /></td>
82                </tr>                   
83        </xsl:template>
84       
85        <xsl:template match="/*/*" mode="select">
86                <option value="{my:extractID(id)}" ><xsl:value-of select="name" /></option>                     
87        </xsl:template>
88
89</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.