source: cats/ISOcat/trunk/mod-ISOcat-interface-rest/representations/html/DCS-check.xsl @ 4895

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

M mod-ISOcat-interface-rest/representations/html/DCS-check.xsl

  • skip DCs with no checking messages
File size: 3.5 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        <!--
12        don't use the xhtml output method,
13        NK (?) will pretty print it during
14        serialization and break the layout
15        -->
16        <xsl:output method="xml" encoding="utf-8"/>
17
18        <xsl:param name="props"/>       
19       
20        <xsl:template match="text()"/>
21       
22        <xsl:function name="isocat:dcs-rest">
23                <xsl:param name="node"/>
24                <xsl:value-of select="$props//site"/>
25                <xsl:text>rest/dcs/</xsl:text>
26                <xsl:value-of select="$node/(@id|@dcs|@ref)"/>
27        </xsl:function>
28       
29        <xsl:function name="isocat:dc-rest">
30                <xsl:param name="node"/>
31                <xsl:value-of select="$props//site"/>
32                <xsl:text>rest/dc/</xsl:text>
33                <xsl:value-of select="$node/@ref"/>
34        </xsl:function>
35
36        <xsl:function name="isocat:dc-link">
37                <xsl:param name="node"/>
38                <span>
39                        <xsl:text>/</xsl:text>
40                    <i>
41                        <a href="{isocat:dc-rest($node)}">
42                            <xsl:choose>
43                                <xsl:when test="exists($node/identifier)">
44                                    <xsl:value-of select="$node/identifier"/>
45                                </xsl:when>
46                                <xsl:otherwise>
47                                    <xsl:value-of select="isocat:dc-rest($node)"/>
48                                </xsl:otherwise>
49                            </xsl:choose>
50                        </a>
51                    </i>
52                        <xsl:text>/</xsl:text>
53                        <xsl:if test="exists($node/name) and ($node/name!=$node/identifier)">
54                                <xsl:text> (</xsl:text>
55                                <xsl:value-of select="$node/name"/>
56                                <xsl:text>)</xsl:text>
57                        </xsl:if>
58                </span>
59        </xsl:function>
60       
61        <xsl:function name="isocat:dcs-link">
62                <xsl:param name="node"/>
63                <span>
64                        <a href="{isocat:dcs-rest($node)}">
65                                <xsl:value-of select="$node/@name"/>
66                        </a>
67                </span>
68        </xsl:function>
69
70        <xsl:function name="isocat:timestamp">
71                <xsl:param name="ts"/>
72                <xsl:sequence select="replace($ts,'\..*','')"/>
73        </xsl:function>
74   
75    <xsl:template match="fatal|error">
76        <div>
77            <b>
78                <xsl:value-of select="local-name()"/>
79            </b>
80            <xsl:text>: </xsl:text>
81            <xsl:value-of select="."/>
82        </div>
83    </xsl:template>
84
85    <xsl:template match="warning">
86        <div>
87            <i>
88                <xsl:value-of select="local-name()"/>
89            </i>
90            <xsl:text>: </xsl:text>
91            <xsl:value-of select="."/>
92        </div>
93    </xsl:template>
94
95    <xsl:template match="dc[exists(checks/*)]">
96                <dt>
97                        <a name="dc{@isocat:id}">
98                                <xsl:copy-of select="isocat:dc-link(.)"/>
99                        </a>
100                </dt>
101                <dd>
102                    <xsl:apply-templates select="checks"/>
103                </dd>
104        </xsl:template>
105       
106        <xsl:function name="isocat:title">
107                <xsl:param name="node"/>
108                <span>
109                        <xsl:text>Check results of the </xsl:text>
110                        <xsl:copy-of select="isocat:dcs-link($node)"/>
111                        <xsl:text> Data Category Selection</xsl:text>
112                </span>
113        </xsl:function>
114       
115        <xsl:template match="/dcs">
116                <xsl:variable name="title" select="isocat:title(.)"/>
117                <html>
118                        <head>
119                                <xsl:if test="exists($title) and (normalize-space(string($title))!='')">
120                                        <title>
121                                                <xsl:value-of select="string($title)"/>
122                                        </title>
123                                </xsl:if>
124                                <link rel="stylesheet" href="{$props//site}interface/JSXAPPS/ISOcat/css/style.css" type="text/css"/>
125                        </head>
126                        <body>
127                                <div class="title">
128                                        <xsl:copy-of select="$title"/>
129                                </div>
130                                <div class="main">
131                                        <dl>
132                                                <xsl:apply-templates/>
133                                        </dl>
134                                </div>
135                        </body>
136                </html>
137        </xsl:template>
138
139</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.