Project

General

Profile

1 10046 mecum
<?xml version="1.0"?>
2
<xsl:stylesheet
3 10159 mecum
    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 10169 mecum
    version="1.0">
7
8 10159 mecum
    <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 10169 mecum
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 10174 mecum
    <!-- TODO: Figure out what this match statement should have in it -->
23 10159 mecum
    <!-- TODO: Cover gmd:identificationInfo/SV_ServiceIdentification -->
24 10169 mecum
25 10159 mecum
    <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 10174 mecum
                            <xsl:apply-templates select="./gmd:fileIdentifier" />
35 10159 mecum
                        </div>
36
                    </div>
37
                </div>
38 10169 mecum
39 10159 mecum
                <!-- TODO: language 1:1 -->
40
                <!-- TODO: characterSet 1:1 -->
41 10169 mecum
42 10159 mecum
                <!-- Parent Identifier 1:1 conditional -->
43 10174 mecum
                <xsl:if test="./gmd:parentIdentifier">
44 10159 mecum
                    <div class="control-group">
45
                        <label class="control-label">Parent Identifier</label>
46
                        <div class="controls">
47
                            <div class="controls-well">
48 10174 mecum
                                <xsl:apply-templates select="./gmd:parentIdentifier" />
49 10159 mecum
                            </div>
50
                        </div>
51
                    </div>
52
                </xsl:if>
53 10169 mecum
54 10159 mecum
                <!-- TODO: hierarchyLevel 0:inf -->
55
                <!-- TODO: hierarchyLevelName 0:inf -->
56 10169 mecum
57 10159 mecum
                <!-- Alternate identifier(s) 0:inf-->
58 10169 mecum
                <!-- gmd:identifier is an optional part of the CI_Citation element -->
59 10174 mecum
                <xsl:for-each select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
60 10159 mecum
                    <div class="control-group">
61 10174 mecum
                        <label class="control-label">Identifier</label>
62 10159 mecum
                        <div class="controls">
63
                            <div class="controls-well">
64
                                <xsl:apply-templates />
65
                            </div>
66
                        </div>
67
                    </div>
68
                </xsl:for-each>
69 10169 mecum
70 10159 mecum
                <!-- Abstract 1:inf-->
71 10174 mecum
                <xsl:for-each select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract">
72 10159 mecum
                    <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 10169 mecum
82 10174 mecum
                <!-- 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 10169 mecum
93 10174 mecum
                <!-- 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 10159 mecum
                    <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 10174 mecum
                                        <xsl:for-each select=".//gmd:topicCategory">
111 10159 mecum
                                            <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 10169 mecum
124 10159 mecum
                <!-- Keywords
125 10046 mecum
126 10174 mecum
                These span multiple MD_DataIdentification Sections so all are
127
                grabbed and rendered in the same place.
128
129 10169 mecum
                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 10159 mecum
                <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 10056 mecum
            </div>
145 10169 mecum
146 10159 mecum
            <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 10174 mecum
                            <xsl:for-each select=".//gmd:contact">
154 10159 mecum
                                <xsl:apply-templates />
155
                            </xsl:for-each>
156
                        </div>
157
                    </div>
158
                </div>
159 10169 mecum
160 10159 mecum
                <!-- 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 10174 mecum
                            <xsl:apply-templates select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
166 10159 mecum
                        </div>
167
                    </div>
168
                </div>
169 10169 mecum
170 10159 mecum
                <!-- 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 10174 mecum
                            <xsl:apply-templates select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
176 10159 mecum
                        </div>
177
                    </div>
178
                </div>
179
            </div>
180 10160 mecum
181
            <xsl:if test="//gmd:distributionInfo">
182
                <div class="control-group entity">
183
                    <h4>Distribution Information</h4>
184
185 10174 mecum
                    <xsl:apply-templates select=".//gmd:distributionInfo" />
186 10160 mecum
                </div>
187
            </xsl:if>
188
189 10159 mecum
            <!-- Extent (geographic, temporal, vertical) -->
190 10174 mecum
            <xsl:for-each select=".//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
191 10056 mecum
                <xsl:apply-templates />
192 10159 mecum
            </xsl:for-each>
193 10169 mecum
194 10159 mecum
            <!-- TODO Methods -->
195 10169 mecum
196 10174 mecum
            <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 10159 mecum
                        <xsl:apply-templates />
203
                    </xsl:for-each>
204 10174 mecum
                </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 10159 mecum
        </form>
229
    </xsl:template>
230 10169 mecum
231 10159 mecum
    <!-- General, high-level templates -->
232
    <!-- TODO: Figure out how to do this: I want to capture the scenario where
233 10169 mecum
    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 10159 mecum
        <xsl:value-of select="@nilReason" />
237
    </xsl:template>
238 10046 mecum
</xsl:stylesheet>