Project

General

Profile

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

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 how to set the output method to get what I want -->
23
    <!-- TODO: ^ Figure out what I want to output -->
24
    <!-- TODO: Figuer out what this match statement should have in it -->
25
    <!-- TODO: Cover gmd:identificationInfo/SV_ServiceIdentification -->
26

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

    
41
                <!-- TODO: language 1:1 -->
42
                <!-- TODO: characterSet 1:1 -->
43

    
44
                <!-- Parent Identifier 1:1 conditional -->
45
                <xsl:if test="//gmd:parentIdentifier">
46
                    <div class="control-group">
47
                        <label class="control-label">Parent Identifier</label>
48
                        <div class="controls">
49
                            <div class="controls-well">
50
                                <xsl:value-of select="//gmd:parentIdentifier/gco:CharacterString/text()" />
51
                            </div>
52
                        </div>
53
                    </div>
54
                </xsl:if>
55

    
56
                <!-- TODO: hierarchyLevel 0:inf -->
57
                <!-- TODO: hierarchyLevelName 0:inf -->
58

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

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

    
84
                <!-- Publication (dateStamp) date 1:1 -->
85
                <div class="control-group">
86
                    <label class="control-label">Publication Date</label>
87
                    <div class="controls">
88
                        <div class="controls-well">
89
                            <xsl:apply-templates select="//gmd:dateStamp" />
90
                        </div>
91
                    </div>
92
                </div>
93

    
94
                <!-- Topic Categories -->
95
                <xsl:if test="//gmd:topicCategory">
96
                    <div class="control-group">
97
                        <label class="control-label">Topic Categories</label>
98
                        <div class="controls">
99
                            <div class="controls-well">
100
                                <table class="table table-condensed">
101
                                    <thead>
102
                                        <tr>
103
                                            <th>Topic</th>
104
                                        </tr>
105
                                    </thead>
106
                                    <tbody>
107
                                        <xsl:for-each select="//gmd:topicCategory">
108
                                            <tr>
109
                                                <td>
110
                                                    <xsl:apply-templates />
111
                                                </td>
112
                                            </tr>
113
                                        </xsl:for-each>
114
                                    </tbody>
115
                                </table>
116
                            </div>
117
                        </div>
118
                    </div>
119
                </xsl:if>
120

    
121
                <!-- Keywords
122

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

    
140
            <div class="control-group entity">
141
                <h4>People and Associated Parties</h4>
142
                <!-- Metadata Contact(s) 1:inf -->
143
                <div class="control-group">
144
                    <label class="control-label">Metadata Contact(s)</label>
145
                    <div class="controls">
146
                        <div class="controls-well">
147
                            <xsl:for-each select="//gmd:contact">
148
                                <xsl:apply-templates />
149
                            </xsl:for-each>
150
                        </div>
151
                    </div>
152
                </div>
153

    
154
                <!-- Data Set Contact(s) -->
155
                <div class="control-group">
156
                    <label class="control-label">Data Set Contacts</label>
157
                    <div class="controls">
158
                        <div class="controls-well">
159
                            <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
160
                        </div>
161
                    </div>
162
                </div>
163

    
164
                <!-- Cited responsible parties-->
165
                <div class="control-group">
166
                    <label class="control-label">Associated Parties</label>
167
                    <div class="controls">
168
                        <div class="controls-well">
169
                            <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
170
                        </div>
171
                    </div>
172
                </div>
173
            </div>
174

    
175
            <xsl:if test="//gmd:distributionInfo">
176
                <div class="control-group entity">
177
                    <h4>Distribution Information</h4>
178

    
179
                    <xsl:apply-templates select="//gmd:distributionInfo" />
180
                </div>
181
            </xsl:if>
182

    
183
            <!-- Extent (geographic, temporal, vertical) -->
184
            <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
185
                <xsl:apply-templates />
186
            </xsl:for-each>
187

    
188
            <!-- TODO Methods -->
189

    
190
            <div class="control-group entity">
191
                <h4>Other Information</h4>
192
                <!-- Data usage rights (resourceConstraints) -->
193
                <xsl:if test="//gmd:resourceConstraints">
194
                    <xsl:for-each select="//gmd:resourceConstraints">
195
                        <xsl:apply-templates />
196
                    </xsl:for-each>
197
                </xsl:if>
198
            </div>
199
        </form>
200
    </xsl:template>
201

    
202
    <!-- General, high-level templates -->
203
    <!-- TODO: Figure out how to do this: I want to capture the scenario where
204
    an element like gmd:individualName has no child gco:CharacterString or
205
    equivalent but has a nilReason attribute. -->
206
    <xsl:template match="*[not(*) and ./@nilReason]">
207
        <xsl:value-of select="@nilReason" />
208
    </xsl:template>
209
</xsl:stylesheet>