1 | <?xml version="1.0"?> |
---|
2 | <xsl:stylesheet |
---|
3 | version="2.0" |
---|
4 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
5 | xmlns:xs="http://www.w3.org/2001/XMLSchema" |
---|
6 | xmlns:isocat="http://www.isocat.org/" |
---|
7 | xmlns:dcr="http://www.isocat.org/ns/dcr" |
---|
8 | xmlns:dcif="http://www.isocat.org/ns/dcif" |
---|
9 | > |
---|
10 | |
---|
11 | <xsl:param name="title" select="'default'"/> |
---|
12 | <xsl:param name="body"/> |
---|
13 | <xsl:param name="props"/> |
---|
14 | |
---|
15 | <xsl:template match="text()"/> |
---|
16 | |
---|
17 | <xsl:function name="isocat:title"> |
---|
18 | <xsl:param name="node"/> |
---|
19 | <xsl:choose> |
---|
20 | <xsl:when test="exists($title) and ($title instance of node()) and (normalize-space(string($title))!='default')"> |
---|
21 | <xsl:choose> |
---|
22 | <xsl:when test="(normalize-space(string($title))!='') and (normalize-space(string($title))!='none')"> |
---|
23 | <xsl:sequence select="normalize-space(string($title))"/> |
---|
24 | </xsl:when> |
---|
25 | </xsl:choose> |
---|
26 | </xsl:when> |
---|
27 | <xsl:when test="exists($node/self::group[normalize-space(name)!=''])"> |
---|
28 | <xsl:sequence select="concat('Thematic Domain Group: ',normalize-space($node/self::group/name))"/> |
---|
29 | </xsl:when> |
---|
30 | </xsl:choose> |
---|
31 | </xsl:function> |
---|
32 | |
---|
33 | <xsl:function name="isocat:name"> |
---|
34 | <xsl:param name="node"/> |
---|
35 | <xsl:choose> |
---|
36 | <xsl:when test="exists($node/name) and (normalize-space($node/name)!='')"> |
---|
37 | <xsl:sequence select="normalize-space($node/name)"/> |
---|
38 | </xsl:when> |
---|
39 | <xsl:otherwise> |
---|
40 | <xsl:sequence select="normalize-space($node/login)"/> |
---|
41 | </xsl:otherwise> |
---|
42 | </xsl:choose> |
---|
43 | </xsl:function> |
---|
44 | |
---|
45 | <xsl:template name="TDG"> |
---|
46 | <div class="DC"> |
---|
47 | <table class="DC"> |
---|
48 | <xsl:for-each select="//group"> |
---|
49 | <xsl:variable name="title" select="isocat:title(.)"/> |
---|
50 | <xsl:if test="exists($title) and (normalize-space($title)!='')"> |
---|
51 | <tr class="DC-title"> |
---|
52 | <th colspan="2"> |
---|
53 | <xsl:value-of select="isocat:title(.)"/> |
---|
54 | </th> |
---|
55 | </tr> |
---|
56 | </xsl:if> |
---|
57 | <tr class="DC-data"> |
---|
58 | <td class="DC-data-label">Name</td> |
---|
59 | <td class="DC-data-value"> |
---|
60 | <xsl:value-of select="name"/> |
---|
61 | </td> |
---|
62 | </tr> |
---|
63 | <tr class="DC-data"> |
---|
64 | <td class="DC-data-label">Description</td> |
---|
65 | <td class="DC-data-value"> |
---|
66 | <xsl:for-each select="tokenize(description,'\n')"> |
---|
67 | <p> |
---|
68 | <xsl:value-of select="."/> |
---|
69 | </p> |
---|
70 | </xsl:for-each> |
---|
71 | </td> |
---|
72 | </tr> |
---|
73 | <tr class="DC-data"> |
---|
74 | <td class="DC-data-label">View</td> |
---|
75 | <td class="DC-data-value"> |
---|
76 | <a href="{$props//site}interface/index.html?view={name}" target="_self"> |
---|
77 | <xsl:text>switch to the TDG specific ISOcat view</xsl:text> |
---|
78 | </a> |
---|
79 | <div>(Note: this will reload the ISOcat UI in your browser and might require you to login again!)</div> |
---|
80 | </td> |
---|
81 | </tr> |
---|
82 | <xsl:if test="exists(forum/@public) or exists(forum/@private)"> |
---|
83 | <tr class="DC-data"> |
---|
84 | <td class="DC-data-label">Forum</td> |
---|
85 | <td class="DC-data-value"> |
---|
86 | <xsl:choose> |
---|
87 | <xsl:when test="exists(forum/@public)"> |
---|
88 | <a href="{$props//forum_site}viewforum.php?f={forum/@public}" target="forum"> |
---|
89 | <xsl:text>public forum</xsl:text> |
---|
90 | </a> |
---|
91 | </xsl:when> |
---|
92 | <xsl:when test="exists(forum/@private)"> |
---|
93 | <a href="{$props//forum_site}viewforum.php?f={forum/@private}" target="forum"> |
---|
94 | <xsl:text>private forum</xsl:text> |
---|
95 | </a> |
---|
96 | </xsl:when> |
---|
97 | </xsl:choose> |
---|
98 | </td> |
---|
99 | </tr> |
---|
100 | </xsl:if> |
---|
101 | <xsl:if test="exists(status or activity)"> |
---|
102 | <tr class="DC-data"> |
---|
103 | <td colspan="2"> </td> |
---|
104 | </tr> |
---|
105 | <xsl:if test="exists(status)"> |
---|
106 | <tr class="DC-data"> |
---|
107 | <td class="DC-data-label">Status</td> |
---|
108 | <td class="DC-data-value"> |
---|
109 | <xsl:value-of select="status"/> |
---|
110 | </td> |
---|
111 | </tr> |
---|
112 | </xsl:if> |
---|
113 | <xsl:if test="exists(activity)"> |
---|
114 | <tr class="DC-data"> |
---|
115 | <td class="DC-data-label">Activity</td> |
---|
116 | <td class="DC-data-value"> |
---|
117 | <xsl:value-of select="activity"/> |
---|
118 | </td> |
---|
119 | </tr> |
---|
120 | </xsl:if> |
---|
121 | </xsl:if> |
---|
122 | <xsl:if test="exists(member)"> |
---|
123 | <tr class="DC-header"> |
---|
124 | <th colspan="2" class="DC-header-level-1">Members</th> |
---|
125 | </tr> |
---|
126 | <xsl:for-each select="member[@status='accepted']"> |
---|
127 | <xsl:sort select="@role"/> |
---|
128 | <tr class="DC-data"> |
---|
129 | <td class="DC-data-label"> |
---|
130 | <xsl:choose> |
---|
131 | <xsl:when test="@role='chair'"> |
---|
132 | <xsl:text>Chair</xsl:text> |
---|
133 | </xsl:when> |
---|
134 | <xsl:otherwise> |
---|
135 | <xsl:text>Member</xsl:text> |
---|
136 | </xsl:otherwise> |
---|
137 | </xsl:choose> |
---|
138 | </td> |
---|
139 | <td class="DC-data-value"> |
---|
140 | <xsl:choose> |
---|
141 | <xsl:when test="forum"> |
---|
142 | <a href="{$props//forum_site}ucp.php?mode=login&redirect=./memberlist.php?mode=viewprofile%26u={forum}" target="forum"> |
---|
143 | <xsl:value-of select="isocat:name(.)"/> |
---|
144 | </a> |
---|
145 | </xsl:when> |
---|
146 | <xsl:otherwise> |
---|
147 | <xsl:value-of select="isocat:name(.)"/> |
---|
148 | </xsl:otherwise> |
---|
149 | </xsl:choose> |
---|
150 | <xsl:if test="exists(organization) and (normalize-space(organization)!='')"> |
---|
151 | <xsl:text> (</xsl:text> |
---|
152 | <xsl:value-of select="normalize-space(organization)"/> |
---|
153 | <xsl:text>)</xsl:text> |
---|
154 | </xsl:if> |
---|
155 | </td> |
---|
156 | </tr> |
---|
157 | </xsl:for-each> |
---|
158 | </xsl:if> |
---|
159 | </xsl:for-each> |
---|
160 | </table> |
---|
161 | </div> |
---|
162 | </xsl:template> |
---|
163 | |
---|
164 | <xsl:template match="/group" priority="1"> |
---|
165 | <xsl:choose> |
---|
166 | <xsl:when test="normalize-space($body)='true'"> |
---|
167 | <html> |
---|
168 | <head> |
---|
169 | <xsl:variable name="title" select="isocat:title(.)"/> |
---|
170 | <xsl:if test="exists($title) and (normalize-space($title)!='')"> |
---|
171 | <title> |
---|
172 | <xsl:value-of select="isocat:title(.)"/> |
---|
173 | </title> |
---|
174 | </xsl:if> |
---|
175 | <link rel="stylesheet" href="{$props//site}interface/JSXAPPS/ISOcat/css/style.css" type="text/css"/> |
---|
176 | </head> |
---|
177 | <body> |
---|
178 | <xsl:call-template name="TDG"/> |
---|
179 | </body> |
---|
180 | </html> |
---|
181 | </xsl:when> |
---|
182 | <xsl:otherwise> |
---|
183 | <xsl:call-template name="TDG"/> |
---|
184 | </xsl:otherwise> |
---|
185 | </xsl:choose> |
---|
186 | </xsl:template> |
---|
187 | |
---|
188 | </xsl:stylesheet> |
---|