source: cats/ISOcat/trunk/mod-ISOcat-interface-rest/representations/html/datacategory.xsl @ 4948

Last change on this file since 4948 was 4948, checked in by Menzo Windhouwer, 10 years ago

M mod-ISOcat-interface-rest/representations/html/datacategory.xsl
M mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/DCViewer.js

  • tweaking the DC HTML view, i.e., admin. info is now collapsed
File size: 21.7 KB
Line 
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:output method="xml" encoding="UTF-8"/>
12
13        <xsl:param name="title" select="'default'"/>
14        <xsl:param name="props"/>
15       
16        <xsl:param name="purpose"/>
17       
18        <xsl:template match="text()"/>
19       
20        <xsl:variable name="DCS" select="document('active:ISOcat.manage.dm.dcs')"/>
21       
22        <xsl:key name="val" match="dcif:value" use="@isocat:id"/>
23
24        <xsl:function name="isocat:name">
25                <xsl:param name="node"/>
26                <xsl:choose>
27                        <xsl:when test="exists($node/@dcr:datcat) and exists($DCS//dcif:dataCategory[@pid=$node/@dcr:datcat]/@isocat:name)">
28                                <xsl:sequence select="$DCS//dcif:dataCategory[@pid=$node/@dcr:datcat]/@isocat:name"/>
29                        </xsl:when>
30                        <xsl:otherwise>
31                                <xsl:sequence select="$node/local-name()"/>
32                        </xsl:otherwise>
33                </xsl:choose>
34        </xsl:function>
35       
36        <xsl:function name="isocat:title">
37                <xsl:param name="node"/>
38                <xsl:choose>
39                        <xsl:when test="exists($title) and ($title instance of node()) and (normalize-space(string($title))!='default')">
40                                <xsl:choose>
41                                        <xsl:when test="(normalize-space(string($title))!='') and (normalize-space(string($title))!='none')">
42                                                <xsl:sequence select="normalize-space(string($title))"/>
43                                        </xsl:when>
44                                </xsl:choose>
45                        </xsl:when>
46                        <xsl:when test="exists($node/self::dcif:dataCategorySelection[normalize-space(@name)!=''])">
47                                <xsl:sequence select="concat('Data Category Selection: ',normalize-space($node/self::dcif:dataCategorySelection/@name))"/>
48                        </xsl:when>
49                        <xsl:when test="exists($node/self::dcif:dataCategory[normalize-space(@isocat:name)!=''])">
50                                <xsl:sequence select="concat('Data Category: ',normalize-space($node/self::dcif:dataCategory/@isocat:name))"/>
51                        </xsl:when>
52                        <xsl:when test="exists($node/self::dcif:dataCategory[normalize-space(//dcif:identifier)!=''])">
53                                <xsl:sequence select="concat('Data Category: ',normalize-space($node/self::dcif:dataCategory//dcif:identifier))"/>
54                        </xsl:when>
55                </xsl:choose>
56        </xsl:function>
57       
58        <xsl:function name="isocat:level">
59                <xsl:param name="node"/>
60                <xsl:sequence select="count($node/ancestor::*[exists(ancestor::dcif:dataCategory)])"/>
61        </xsl:function>
62               
63        <xsl:function name="isocat:section">
64                <xsl:param name="node"/>
65                <xsl:variable name="level" select="isocat:level($node)"/>
66
67                <xsl:choose>
68                        <xsl:when test="$level=0">
69                                <xsl:sequence select="count($node/preceding-sibling::*[exists(child::*)]) + 1"/>
70                        </xsl:when>
71                        <xsl:when test="$level=1 or $level=2">
72                                <xsl:sequence select="concat(isocat:section(($node/parent::*)[last()]),'.',count($node/preceding-sibling::*[exists(child::*)]) + 1)"/>
73                        </xsl:when>
74                        <xsl:otherwise>
75                                <xsl:sequence select="''"/>
76                        </xsl:otherwise>
77                </xsl:choose>
78        </xsl:function>
79       
80        <xsl:template match="isocat:*" priority="1"/>
81       
82        <xsl:template match="isocat:administrationStatus" priority="10">
83            <xsl:param name="class" select="''" tunnel="yes"/>
84            <tr class="DC-data{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
85                        <td class="DC-data-label">
86                                <xsl:value-of select="isocat:name(.)"/>
87                        </td>
88                        <td class="DC-data-value">
89                                <div>
90                                        <xsl:value-of select="text()"/>
91                                </div>
92                        </td>
93                </tr>
94        </xsl:template>
95       
96        <xsl:template name="reference">
97                <xsl:param name="indent" select="''" tunnel="yes"/>
98                <tr class="DC-data">
99                        <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
100                                <xsl:attribute name="style" select="'color:gray;'"/>
101                        </xsl:if>
102                        <td class="DC-data-label">
103                                <xsl:value-of select="isocat:name(.)"/>
104                        </td>
105                        <td class="DC-data-value">
106                                <span stle="color:gray;">
107                                        <xsl:value-of select="$indent"/>
108                                </span>
109                                <span>
110                                        <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
111                                                <xsl:attribute name="style" select="'color:gray;'"/>
112                                        </xsl:if>
113                                        <xsl:text>/</xsl:text>
114                                        <a href="{@pid}" target="other" datcat="{@isocat:id}">
115                                                <xsl:choose>
116                                                        <xsl:when test="exists(@isocat:identifier)">
117                                                                <xsl:value-of select="@isocat:identifier"/>
118                                                        </xsl:when>
119                                                        <xsl:otherwise>
120                                                                <xsl:value-of select="@pid"/>
121                                                        </xsl:otherwise>
122                                                </xsl:choose>
123                                        </a>
124                                        <xsl:text>/</xsl:text>
125                                </span>
126                                <span>
127                                        <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
128                                                <xsl:attribute name="style" select="'color:gray;'"/>
129                                        </xsl:if>
130                                        <xsl:if test="exists(@isocat:name) and (@isocat:name!=@isocat:identifier)">
131                                                <xsl:text> (</xsl:text>
132                                                <xsl:value-of select="@isocat:name"/>
133                                                <xsl:text>)</xsl:text>
134                                        </xsl:if>
135                                </span>
136                                <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
137                                        <div style="color:gray;">
138                                                <xsl:text>Note: this data category isn't a member of the currently selected Data Category Selection or profile!</xsl:text>
139                                        </div>
140                                </xsl:if>
141                        </td>
142                </tr>
143        </xsl:template>
144       
145        <xsl:template match="dcif:isA" priority="1"/>
146       
147        <xsl:template match="dcif:conceptualDomain[@type='closed']" priority="1">
148                <xsl:param name="class" select="''" tunnel="yes"/>
149                <xsl:variable name="level" select="isocat:level(.)"/>
150                <tr class="DC-header{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
151                        <th colspan="2">
152                                <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
153                                        <xsl:attribute name="style" select="'color:gray;'"/>
154                                </xsl:if>
155                                <xsl:choose>
156                                        <xsl:when test="$level &lt; 1">
157                                                <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
158                                                <xsl:value-of select="isocat:section(.)"/>
159                                                <xsl:text>. </xsl:text>
160                                                <xsl:value-of select="isocat:name(.)"/>
161                                        </xsl:when>
162                                        <xsl:when test="$level &lt; 2">
163                                                <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
164                                                <xsl:value-of select="isocat:section(.)"/>
165                                                <xsl:text> </xsl:text>
166                                                <xsl:value-of select="isocat:name(.)"/>
167                                        </xsl:when>
168                                        <xsl:otherwise>
169                                                <xsl:attribute name="class" select="'DC-header-level-x'"/>
170                                                <xsl:value-of select="isocat:section(.)"/>
171                                                <xsl:text> </xsl:text>
172                                                <xsl:value-of select="isocat:name(.)"/>
173                                        </xsl:otherwise>
174                                </xsl:choose>
175                        </th>
176                </tr>
177                <xsl:apply-templates select="child::*[empty(child::*)] except dcif:note"/>
178                <xsl:apply-templates select="child::*[exists(child::*)] except dcif:value"/>
179                <xsl:for-each select="dcif:value[empty(@isocat:isa) or empty(key('val',@isocat:isa,current()))]">
180                        <xsl:apply-templates select=".">
181                                <xsl:with-param name="indent" select="''" tunnel="yes"/>
182                        </xsl:apply-templates>
183                </xsl:for-each>
184                <xsl:if test="exists(dcif:note[normalize-space(.)!=''])">
185                        <tr class="DC-header">
186                                <th colspan="2" class="DC-header-level-x">
187                                        <xsl:value-of select="isocat:section(.)"/>
188                                        <xsl:text>.</xsl:text>
189                                        <xsl:value-of select="count(child::*[exists(child::*)]) + 1"/>
190                                        <xsl:text> Note Section</xsl:text>
191                                </th>
192                        </tr>
193                        <xsl:apply-templates select="dcif:note[normalize-space(.)!='']"/>
194                </xsl:if>
195        </xsl:template>
196       
197        <xsl:template match="dcif:value" priority="1">
198                <xsl:param name="indent" tunnel="yes"/>
199                <xsl:call-template name="reference">
200                        <xsl:with-param name="indent" select="$indent"/>
201                </xsl:call-template>
202                <xsl:for-each select="../dcif:value[@isocat:isa=current()/@isocat:id]">
203                        <xsl:apply-templates select=".">
204                                <xsl:with-param name="indent" select="concat($indent,'&#183;&#160;')" tunnel="yes"/>
205                        </xsl:apply-templates>
206                </xsl:for-each>
207        </xsl:template>
208       
209        <xsl:template match="dcif:language" priority="1">
210                <xsl:param name="class" select="''" tunnel="yes"/>
211                <tr class="DC-data{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
212                        <td class="DC-data-label">
213                                <xsl:value-of select="isocat:name(.)"/>
214                        </td>
215                        <td class="DC-data-value">
216                                <xsl:choose>
217                                        <xsl:when test="exists(@isocat:name)">
218                                                <xsl:value-of select="@isocat:name"/>
219                                                <xsl:text> (</xsl:text>
220                                                <xsl:value-of select="text()"/>
221                                                <xsl:text>)</xsl:text>
222                                        </xsl:when>
223                                        <xsl:otherwise>
224                                                <xsl:value-of select="text()"/>
225                                        </xsl:otherwise>
226                                </xsl:choose>
227                        </td>
228                </tr>
229        </xsl:template>
230       
231        <xsl:template match="dcif:languageSection" priority="1">
232                <xsl:variable name="dc" select="ancestor::dcif:dataCategory[last()]/@isocat:id"/>
233                <xsl:variable name="class" select="concat('dc-',$dc,'-langsec-',dcif:language)"/>
234                <xsl:variable name="classes" select="concat(if (dcif:language!='en') then (concat('dc-',$dc,'-langsec ')) else (''),$class)"/>
235                <tr class="DC-header">
236                        <th colspan="2" class="DC-header-level-2">
237                                <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
238                                        <xsl:attribute name="style" select="'color:gray;'"/>
239                                </xsl:if>
240                                <!--<pre style="display:inline;cursor:pointer;cursor:hand;" onclick="var span = this;$('.{$class}').toggle(1000,function() {{span.innerHTML = '['+(span.innerHTML=='[+] '?'-':'+')+'] ';}});">-->
241                                <pre style="display:inline;cursor:pointer;cursor:hand;" onclick="var span = this;$('.{$class}').toggle(1000);span.innerHTML = '['+(span.innerHTML=='[+] '?'-':'+')+'] ';">                                      <xsl:choose>
242                                                <xsl:when test="dcif:language='en'">
243                                                        <xsl:text>[-] </xsl:text>
244                                                </xsl:when>
245                                                <xsl:otherwise>
246                                                        <xsl:text>[+] </xsl:text>
247                                                </xsl:otherwise>
248                                        </xsl:choose>
249                                </pre>
250                                <xsl:value-of select="isocat:section(.)"/>
251                                <xsl:text> </xsl:text>
252                                <xsl:choose>
253                                        <xsl:when test="exists(dcif:language/@isocat:name)">
254                                                <xsl:value-of select="dcif:language/@isocat:name"/>
255                                        </xsl:when>
256                                        <xsl:otherwise>
257                                                <xsl:value-of select="dcif:language"/>
258                                        </xsl:otherwise>
259                                </xsl:choose>
260                                <xsl:text> </xsl:text>
261                                <xsl:value-of select="isocat:name(.)"/>
262                        </th>
263                </tr>
264                <xsl:apply-templates select="child::*[empty(child::*)] except dcif:note">
265                        <xsl:with-param name="class" select="$classes" tunnel="yes"/>
266                </xsl:apply-templates>
267                <xsl:apply-templates select="child::*[exists(child::*)]">
268                        <xsl:with-param name="class" select="$classes" tunnel="yes"/>
269                </xsl:apply-templates>
270                <xsl:if test="exists(dcif:note[normalize-space(.)!=''])">
271                        <tr class="DC-header {$classes}">
272                                <th colspan="2" class="DC-header-level-x">
273                                        <xsl:value-of select="isocat:section(.)"/>
274                                        <xsl:text>.</xsl:text>
275                                        <xsl:value-of select="count(child::*[exists(child::*)]) + 1"/>
276                                        <xsl:text> Note Section</xsl:text>
277                                </th>
278                        </tr>
279                        <xsl:apply-templates select="dcif:note[normalize-space(.)!='']">
280                                <xsl:with-param name="class" select="$classes" tunnel="yes"/>
281                        </xsl:apply-templates>
282                </xsl:if>
283        </xsl:template>
284       
285    <xsl:template match="dcif:administrationRecord" priority="1">
286        <xsl:param name="class" select="''" tunnel="yes"/>
287        <xsl:variable name="dc" select="ancestor::dcif:dataCategory[last()]/@isocat:id"/>
288        <xsl:variable name="c" select="concat('dc-',$dc,'-adminrec')"/>
289        <xsl:variable name="classes" select="string-join(($c,$class),' ')"/>
290        <xsl:variable name="level" select="isocat:level(.)"/>
291        <tr class="DC-header{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
292            <th colspan="2">
293                <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
294                    <xsl:attribute name="style" select="'color:gray;'"/>
295                </xsl:if>
296                <xsl:choose>
297                    <xsl:when test="$level &lt; 1">
298                        <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
299                    </xsl:when>
300                    <xsl:when test="$level &lt; 2">
301                        <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
302                    </xsl:when>
303                    <xsl:otherwise>
304                        <xsl:attribute name="class" select="'DC-header-level-x'"/>
305                    </xsl:otherwise>
306                </xsl:choose>
307                <pre style="display:inline;cursor:pointer;cursor:hand;" onclick="var span = this;$('.{$c}').toggle(1000);span.innerHTML = '['+(span.innerHTML=='[+] '?'-':'+')+'] ';">
308                                    <xsl:text>[+] </xsl:text>
309                        </pre>
310                <xsl:value-of select="isocat:section(.)"/>
311                <xsl:text>. </xsl:text>
312                <xsl:value-of select="isocat:name(.)"/>
313            </th>
314        </tr>
315        <xsl:apply-templates select="child::*[empty(child::*)] except dcif:note">
316            <xsl:with-param name="class" select="$classes" tunnel="yes"/>
317        </xsl:apply-templates>
318        <xsl:apply-templates select="child::*[exists(child::*)]">
319            <xsl:with-param name="class" select="$classes" tunnel="yes"/>
320        </xsl:apply-templates>
321        <xsl:if test="exists(dcif:note[normalize-space(.)!=''])">
322            <tr class="DC-header">
323                <th colspan="2" class="DC-header-level-x">
324                    <xsl:value-of select="isocat:section(.)"/>
325                    <xsl:text>.</xsl:text>
326                    <xsl:value-of select="count(child::*[exists(child::*)]) + 1"/>
327                    <xsl:text> Note Section</xsl:text>
328                </th>
329            </tr>
330            <xsl:apply-templates select="dcif:note[normalize-space(.)!='']"/>
331        </xsl:if>
332    </xsl:template>
333   
334    <xsl:template match="*[empty(child::dcif:*)]">
335                <xsl:param name="class" select="''" tunnel="yes"/>
336                <tr class="DC-data{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
337                        <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
338                                <xsl:attribute name="style" select="'color:gray;'"/>
339                        </xsl:if>
340                        <td class="DC-data-label">
341                                <xsl:value-of select="isocat:name(.)"/>
342                        </td>
343                        <td class="DC-data-value">
344                                <div>
345                                <xsl:if test="exists(@isocat:direction)">
346                                        <xsl:attribute name="style" select="concat('direction:',@isocat:direction,';')"/>
347                                </xsl:if>
348                                <xsl:choose>
349                                        <xsl:when test="normalize-space(.)!=''">
350                                                <xsl:value-of select="text()"/>
351                                        </xsl:when>
352                                        <xsl:when test="exists(@pid)">
353                                                <a href="{@pid}" target="other">
354                                                        <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
355                                                                <xsl:attribute name="style" select="'color:gray;'"/>
356                                                        </xsl:if>
357                                                        <xsl:choose>
358                                                                <xsl:when test="exists(@isocat:name)">
359                                                                        <xsl:value-of select="@isocat:name"/>
360                                                                </xsl:when>
361                                                                <xsl:otherwise>
362                                                                        <xsl:value-of select="@pid"/>
363                                                                </xsl:otherwise>
364                                                        </xsl:choose>
365                                                </a>
366                                        </xsl:when>
367                                </xsl:choose>
368                                </div>
369                        </td>
370                </tr>
371        </xsl:template>
372   
373        <xsl:template match="*[exists(child::dcif:*)]">
374                <xsl:param name="class" select="''" tunnel="yes"/>
375                <xsl:variable name="level" select="isocat:level(.)"/>
376                <tr class="DC-header{if (normalize-space($class)!='') then (concat(' ',$class)) else ()}">
377                        <th colspan="2">
378                                <xsl:if test="ancestor-or-self::*/@isocat:suppress='true'">
379                                        <xsl:attribute name="style" select="'color:gray;'"/>
380                                </xsl:if>
381                                <xsl:choose>
382                                        <xsl:when test="$level &lt; 1">
383                                                <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
384                                                <xsl:value-of select="isocat:section(.)"/>
385                                                <xsl:text>. </xsl:text>
386                                                <xsl:value-of select="isocat:name(.)"/>
387                                        </xsl:when>
388                                        <xsl:when test="$level &lt; 2">
389                                                <xsl:attribute name="class" select="concat('DC-header-level-',$level + 1)"/>
390                                                <xsl:value-of select="isocat:section(.)"/>
391                                                <xsl:text> </xsl:text>
392                                                <xsl:value-of select="isocat:name(.)"/>
393                                        </xsl:when>
394                                        <xsl:otherwise>
395                                                <xsl:attribute name="class" select="'DC-header-level-x'"/>
396                                                <xsl:value-of select="isocat:section(.)"/>
397                                                <xsl:text> </xsl:text>
398                                                <xsl:value-of select="isocat:name(.)"/>
399                                        </xsl:otherwise>
400                                </xsl:choose>
401                        </th>
402                </tr>
403                <xsl:apply-templates select="child::*[empty(child::*)] except dcif:note"/>
404                <xsl:apply-templates select="child::*[exists(child::*)]"/>
405                <xsl:if test="exists(dcif:note[normalize-space(.)!=''])">
406                        <tr class="DC-header">
407                                <th colspan="2" class="DC-header-level-x">
408                                        <xsl:value-of select="isocat:section(.)"/>
409                                        <xsl:text>.</xsl:text>
410                                        <xsl:value-of select="count(child::*[exists(child::*)]) + 1"/>
411                                        <xsl:text> Note Section</xsl:text>
412                                </th>
413                        </tr>
414                        <xsl:apply-templates select="dcif:note[normalize-space(.)!='']"/>
415                </xsl:if>
416        </xsl:template>
417       
418        <xsl:template name="DC">
419                <div class="DC">
420                        <table class="DC">
421                                <xsl:for-each select="//dcif:dataCategory">
422                                        <xsl:variable name="title" select="isocat:title(.)"/>
423                                        <xsl:if test="exists($title) and (normalize-space($title)!='')">
424                                                <tr class="DC-title">
425                                                        <th colspan="2">
426                                                                <xsl:value-of select="isocat:title(.)"/>
427                                                        </th>
428                                                </tr>
429                                        </xsl:if>
430                                        <xsl:choose>
431                                                <xsl:when test=".//dcif:registrationStatus='superseded'">
432                                                        <tr class="DC-title">
433                                                                <th colspan="2">
434                                                                        <span style="color:red;font-weight:bold;">WARNING: </span>
435                                                                        <xsl:text>This data category is superseded</xsl:text>
436                                                                        <xsl:if test="exists(isocat:next)">
437                                                                                <xsl:for-each select="isocat:next">
438                                                                                        <xsl:text> by </xsl:text>
439                                                                                        <span>
440                                                                                                <xsl:text>/</xsl:text>
441                                                                                                <a href="{@pid}" target="other" datcat="{@isocat:id}">
442                                                                                                        <xsl:value-of select="@isocat:identifier"/>
443                                                                                                        <xsl:text>-</xsl:text>
444                                                                                                        <xsl:value-of select="@isocat:version"/>
445                                                                                                </a>
446                                                                                                <xsl:text>/</xsl:text>
447                                                                                        </span>
448                                                                                        <span>
449                                                                                                <xsl:if test="exists(@isocat:name) and (@isocat:name!=@isocat:identifier)">
450                                                                                                        <xsl:text> (</xsl:text>
451                                                                                                        <xsl:value-of select="@isocat:name"/>
452                                                                                                        <xsl:text>)</xsl:text>
453                                                                                                </xsl:if>
454                                                                                        </span>
455                                                                                </xsl:for-each>
456                                                                        </xsl:if>
457                                                                        <xsl:text>!</xsl:text>
458                                                                </th>
459                                                        </tr>
460                                                </xsl:when>
461                                                <xsl:when test=".//dcif:registrationStatus='deprecated'">
462                                                        <tr class="DC-title">
463                                                                <th colspan="2">
464                                                                        <span style="color:red;font-weight:bold;">WARNING: </span>
465                                                                        <xsl:text>This data category is deprecated! Refrain from using it.</xsl:text>
466                                                                </th>
467                                                        </tr>
468                                                </xsl:when>
469                                                <xsl:otherwise>
470                                                        <xsl:for-each select="isocat:recommendedBy">
471                                                                <tr class="DC-data">
472                                                                        <td class="DC-data-label">Recommended by</td>
473                                                                        <td class="DC-data-value">
474                                                                                <a href="{$props//site}rest/group/{@id}" group="{@id}"><xsl:value-of select="."/></a>
475                                                                        </td>
476                                                                </tr>
477                                                        </xsl:for-each>
478                                                        <xsl:if test="exists(isocat:recommendedBy)">
479                                                                <tr>
480                                                                        <th colspan="2">&#160;</th>
481                                                                </tr>
482                                                        </xsl:if>
483                                                </xsl:otherwise>
484                                        </xsl:choose>
485                                        <!--<tr class="DC-data">
486                                                <td class="DC-data-label">Key</td>
487                                                <td class="DC-data-value">
488                                                        <xsl:value-of select="@isocat:id"/>
489                                                </td>
490                                        </tr>-->
491                                        <tr class="DC-data">
492                                                <td class="DC-data-label">PID</td>
493                                                <td class="DC-data-value">
494                                                        <a href="{@pid}" target="other">
495                                                                <xsl:value-of select="@pid"/>
496                                                        </a>
497                                                </td>
498                                        </tr>
499                                        <tr class="DC-data">
500                                                <td class="DC-data-label">Type</td>
501                                                <td class="DC-data-value">
502                                                        <xsl:choose>
503                                                                <xsl:when test="@isocat:type=@type">
504                                                                        <xsl:value-of select="@type"/>
505                                                                </xsl:when>
506                                                                <xsl:otherwise>
507                                                                        <xsl:value-of select="@type"/>
508                                                                        <xsl:text>/</xsl:text>
509                                                                        <xsl:value-of select="@isocat:type"/>
510                                                                </xsl:otherwise>
511                                                        </xsl:choose>
512                                                </td>
513                                        </tr>
514                                        <tr class="DC-data">
515                                                <td class="DC-data-label">Owner</td>
516                                                <td class="DC-data-value">
517                                                        <xsl:choose>
518                                                                <xsl:when test="exists(@isocat:owner_forum)">
519                                                                        <a href="{$props//forum_site}ucp.php?mode=login&amp;redirect=./memberlist.php?mode=viewprofile%26u={@isocat:owner_forum}" target="forum">
520                                                                                <xsl:value-of select="@isocat:owner"/>
521                                                                        </a>
522                                                                </xsl:when>
523                                                                <xsl:otherwise>
524                                                                        <xsl:value-of select="@isocat:owner"/>
525                                                                </xsl:otherwise>
526                                                        </xsl:choose>
527                                                </td>
528                                        </tr>
529                                        <tr class="DC-data">
530                                                <td class="DC-data-label">Scope</td>
531                                                <td class="DC-data-value">
532                                                        <xsl:value-of select="@isocat:scope"/>
533                                                </td>
534                                        </tr>
535                                        <xsl:if test="exists(dcif:isA)">
536                                                <tr>
537                                                        <th colspan="2">&#160;</th>
538                                                </tr>
539                                                <xsl:for-each select="dcif:isA">
540                                                        <xsl:call-template name="reference"/>
541                                                </xsl:for-each>
542                                        </xsl:if>
543                                        <xsl:apply-templates/>
544                                </xsl:for-each>
545                        </table>
546                </div>
547        </xsl:template>
548
549        <xsl:template match="/dcif:dataCategorySelection" priority="1">
550                <html>
551                        <head>
552                                <xsl:variable name="title" select="isocat:title(.)"/>
553                                <xsl:if test="exists($title) and (normalize-space($title)!='')">
554                                        <title>
555                                                <xsl:value-of select="isocat:title(.)"/>
556                                        </title>
557                                </xsl:if>
558                                <link rel="stylesheet" href="{$props//site}interface/JSXAPPS/ISOcat/css/style.css" type="text/css"/>
559                                <script type="text/javascript" src="{$props//site}interface/addins/jquery/js/jquery-1.6.4.js">
560                                        <xsl:comment>keep the script alive in IE</xsl:comment>
561                                </script>
562                                <script type="text/javascript">
563                                        $(document).ready(function() {
564                                        <xsl:for-each select=".//dcif:dataCategory">
565                                                <xsl:variable name="dc" select="@isocat:id"/>
566                                            $('.dc-<xsl:value-of select="$dc"/>-adminrec').toggle();
567                                            $('.dc-<xsl:value-of select="$dc"/>-langsec').toggle();
568                                                $('.dc-<xsl:value-of select="$dc"/>-langsec-en').addClass('dc-<xsl:value-of select="$dc"/>-langsec');
569                                        </xsl:for-each>
570                                        });
571                                </script>
572                        </head>
573                        <body>
574                                <xsl:if test="$purpose='print'">
575                                        <xsl:attribute name="onload" select="'self.print()'"/>
576                                </xsl:if>
577                                <xsl:text>[ </xsl:text>
578                                <a href="{$props//site}rest/dc/{dcif:dataCategory/@isocat:id}/context">context</a>
579                                <xsl:text> | </xsl:text>
580                                <a href="{$props//site}rest/dc/{dcif:dataCategory/@isocat:id}/history">history</a>
581                                <xsl:text> ]</xsl:text>
582                                <div class="main">
583                                        <xsl:call-template name="DC"/>
584                                </div>
585                        </body>
586                </html>
587        </xsl:template>
588
589</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.