Project

General

Profile

metacat / lib / style / skins / metacatui / iso19115 / isoroot.xsl @ 10194

1
<?xml version="1.0"?>
2
<xsl:stylesheet 
3
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
4
    xmlns:gmd="http://www.isotc211.org/2005/gmd" 
5
    xmlns:gco="http://www.isotc211.org/2005/gco" 
6
    version="1.0">
7

    
8
    <xsl:import href="iso-md.xsl"/>
9
    <xsl:import href="iso-ci.xsl"/>
10
    <xsl:import href="iso-ex.xsl"/>
11
    <xsl:import href="iso-gco.xsl"/>
12
    <xsl:import href="iso-gmd.xsl"/>
13
    <xsl:import href="iso-gml.xsl"/>
14
    <xsl:import href="iso-gmx.xsl"/>
15

    
16
    <xsl:output method="html"
17
                encoding="UTF-8"
18
                doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
19
                doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
20
                indent="yes" />
21

    
22
    <!-- TODO: Figure out what this match statement should have in it -->
23
    <!-- TODO: Cover gmd:identificationInfo/SV_ServiceIdentification -->
24

    
25
    <xsl:template match="*[local-name()='MD_Metadata'] | *[local-name()='MI_Metadata']">
26
        <form class="form-horizontal">
27
            <div class="control-group entity">
28
                <h4>General</h4>
29
                <!-- fileIdentifier 1:1 -->
30
                <div class="control-group">
31
                    <label class="control-label">Identifier</label>
32
                    <div class="controls">
33
                        <div class="controls-well">
34
                            <xsl:apply-templates select="./gmd:fileIdentifier" />
35
                        </div>
36
                    </div>
37
                </div>
38

    
39
                <!-- TODO: language 1:1 -->
40
                <!-- TODO: characterSet 1:1 -->
41

    
42
                <!-- Parent Identifier 1:1 conditional -->
43
                <xsl:if test="./gmd:parentIdentifier">
44
                    <div class="control-group">
45
                        <label class="control-label">Parent Identifier</label>
46
                        <div class="controls">
47
                            <div class="controls-well">
48
                                <xsl:apply-templates select="./gmd:parentIdentifier" />
49
                            </div>
50
                        </div>
51
                    </div>
52
                </xsl:if>
53

    
54
                <!-- TODO: hierarchyLevel 0:inf -->
55
                <!-- TODO: hierarchyLevelName 0:inf -->
56

    
57
                <!-- Alternate identifier(s) 0:inf-->
58
                <!-- gmd:identifier is an optional part of the CI_Citation element -->
59
                <xsl:for-each select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
60
                    <div class="control-group">
61
                        <label class="control-label">Identifier</label>
62
                        <div class="controls">
63
                            <div class="controls-well">
64
                                <xsl:apply-templates />
65
                            </div>
66
                        </div>
67
                    </div>
68
                </xsl:for-each>
69

    
70
                <!-- Abstract 1:inf-->
71
                <xsl:for-each select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
72
                    <div class="control-group">
73
                        <label class="control-label">Abstract</label>
74
                        <div class="controls">
75
                            <div class="controls-well">
76
                                <xsl:apply-templates />
77
                            </div>
78
                        </div>
79
                    </div>
80
                </xsl:for-each>
81

    
82
                <!-- Publication 1:1 -->
83
                <!-- TODO: Find out where this is in the metadata. -->
84
                <!--<div class="control-group">-->
85
                    <!--<label class="control-label">Publication Date</label>-->
86
                    <!--<div class="controls">-->
87
                        <!--<div class="controls-well">-->
88
                            <!--<xsl:apply-templates select="./gmd:dateStamp" />-->
89
                        <!--</div>-->
90
                    <!--</div>-->
91
                <!--</div>-->
92

    
93
                <!-- Topic Categories
94

    
95
                These span multiple MD_DataIdentification Sections so all are
96
                grabbed and rendered in the same place.
97
                -->
98
                <xsl:if test=".//gmd:topicCategory">
99
                    <div class="control-group">
100
                        <label class="control-label">Topic Categories</label>
101
                        <div class="controls">
102
                            <div class="controls-well">
103
                                <table class="table table-condensed">
104
                                    <thead>
105
                                        <tr>
106
                                            <th>Topic</th>
107
                                        </tr>
108
                                    </thead>
109
                                    <tbody>
110
                                        <xsl:for-each select=".//gmd:topicCategory">
111
                                            <tr>
112
                                                <td>
113
                                                    <xsl:apply-templates />
114
                                                </td>
115
                                            </tr>
116
                                        </xsl:for-each>
117
                                    </tbody>
118
                                </table>
119
                            </div>
120
                        </div>
121
                    </div>
122
                </xsl:if>
123

    
124
                <!-- Keywords
125

    
126
                These span multiple MD_DataIdentification Sections so all are
127
                grabbed and rendered in the same place.
128

    
129
                Each <gmd:descriptiveKeywords> block should have one or more keywords in it
130
                with one thesaurus. So we render keywords from the same thesaurus together.
131
                -->
132
                <xsl:if test="//gmd:descriptiveKeywords">
133
                    <div class="control-group">
134
                        <label class="control-label">Descriptive Keywords</label>
135
                        <div class="controls">
136
                            <div class="controls-well">
137
                                <xsl:for-each select="//gmd:descriptiveKeywords">
138
                                    <xsl:apply-templates />
139
                                </xsl:for-each>
140
                            </div>
141
                        </div>
142
                    </div>
143
                </xsl:if>
144
            </div>
145

    
146
            <div class="control-group entity">
147
                <h4>People and Associated Parties</h4>
148
                <!-- Metadata Contact(s) 1:inf -->
149
                <div class="control-group">
150
                    <label class="control-label">Metadata Contact(s)</label>
151
                    <div class="controls">
152
                        <div class="controls-well">
153
                            <xsl:for-each select=".//gmd:contact">
154
                                <xsl:apply-templates />
155
                            </xsl:for-each>
156
                        </div>
157
                    </div>
158
                </div>
159

    
160
                <!-- Data Set Contact(s) -->
161
                <div class="control-group">
162
                    <label class="control-label">Data Set Contacts</label>
163
                    <div class="controls">
164
                        <div class="controls-well">
165
                            <xsl:apply-templates select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
166
                        </div>
167
                    </div>
168
                </div>
169

    
170
                <!-- Cited responsible parties-->
171
                <div class="control-group">
172
                    <label class="control-label">Associated Parties</label>
173
                    <div class="controls">
174
                        <div class="controls-well">
175
                            <xsl:apply-templates select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
176
                        </div>
177
                    </div>
178
                </div>
179
            </div>
180

    
181
            <xsl:if test="//gmd:distributionInfo">
182
                <div class="control-group entity">
183
                    <h4>Distribution Information</h4>
184

    
185
                    <xsl:apply-templates select=".//gmd:distributionInfo" />
186
                </div>
187
            </xsl:if>
188

    
189
            <!-- Extent (geographic, temporal, vertical) -->
190
            <xsl:for-each select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
191
                <xsl:apply-templates />
192
            </xsl:for-each>
193

    
194
            <!-- TODO Methods -->
195

    
196
            <xsl:if test=".//gmd:metadataConstraints">
197

    
198
                <div class="control-group entity">
199
                    <h4>Metadata Constraints</h4>
200

    
201
                    <xsl:for-each select=".//gmd:metadataConstraints">
202
                        <xsl:apply-templates />
203
                    </xsl:for-each>
204
                </div>
205
            </xsl:if>
206

    
207
            <xsl:if test=".//gmd:resourceConstraints">
208
                <div class="control-group entity">
209

    
210
                <h4>Resource Constraints</h4>
211
                    <xsl:for-each select=".//gmd:resourceConstraints">
212
                        <xsl:apply-templates />
213
                    </xsl:for-each>
214
                </div>
215
            </xsl:if>
216

    
217
            <xsl:if test=".//gmd:supplementalInformation">
218
                <div class="control-group entity">
219

    
220
                    <h4>Supplemental Information</h4>
221
                    <xsl:for-each select=".//gmd:supplementalInformation">
222
                        <xsl:apply-templates />
223
                    </xsl:for-each>
224
                </div>
225
            </xsl:if>
226

    
227

    
228
        </form>
229
    </xsl:template>
230

    
231
    <!-- General, high-level templates -->
232
    <!-- TODO: Figure out how to do this: I want to capture the scenario where
233
    an element like gmd:individualName has no child gco:CharacterString or
234
    equivalent but has a nilReason attribute. -->
235
    <xsl:template match="*[not(*) and ./@nilReason]">
236
        <xsl:value-of select="@nilReason" />
237
    </xsl:template>
238
</xsl:stylesheet>