Project

General

Profile

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
    xmlns:gmx="http://www.isotc211.org/2005/gmx"
7
    xmlns:gml="http://www.opengis.net/gml/3.2" 
8
    xmlns:xlink="http://www.w3.org/1999/xlink"
9
    version="1.0">
10

    
11
    <xsl:import href="iso-ci.xsl"/>
12
    <xsl:import href="iso-ex.xsl"/>
13
    <xsl:import href="iso-md.xsl"/>
14

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

    
20
    <!-- TODO: Figure out how to set the output method to get what I want -->
21
    <!-- TODO: ^ Figure out what I want to output -->
22
    <!-- TODO: Figuer out what this match statement should have in it -->
23
    <xsl:template match="*[local-name()='MD_Metadata'] | *[local-name()='MI_Metadata']">
24
        <form class="form-horizontal">
25
            <!-- Dataset title -->
26
            <div class="control-group">
27
                <label class="control-label">Identifier</label>
28
                <div class="controls">
29
                    <div class="controls-well">
30
                        <xsl:value-of select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" />
31
                    </div>
32
                </div>
33
            </div>
34

    
35
            <!-- Identifier -->
36
            <div class="control-group">
37
                <label class="control-label">Identifier</label>
38
                <div class="controls">
39
                    <div class="controls-well">
40
                        <xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" />
41
                    </div>
42
                </div>
43
            </div>
44

    
45
            <!-- Alternate identifier(s) -->
46
            <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
47
                <xsl:call-template name="alternateidentifier"/>
48
            </xsl:for-each>
49

    
50
            <!-- Abstract -->
51
            <div class="control-group">
52
                <label class="control-label">Abstract</label>
53
                <div class="controls">
54
                    <div class="controls-well">
55
                        <xsl:value-of select="//gmd:abstract/gco:CharacterString/text()" />
56
                    </div>
57
                </div>
58
            </div>
59

    
60
            <!--  Topic Categories -->
61
            <xsl:if test="//gmd:topicCategory">
62
                <div class="control-group">
63
                    <label class="control-label">Topic Categories</label>
64
                    <div class="controls">
65
                        <div class="controls-well">
66
                            <ul>
67
                                <xsl:for-each select="//gmd:topicCategory">
68
                                    <li><xsl:value-of select="./gmd:MD_TopicCategoryCode/text()" /></li>                
69
                                </xsl:for-each>
70
                            </ul>
71
                        </div>
72
                    </div>
73
                </div>
74
            </xsl:if>
75
            
76

    
77
            <!-- Keywords
78

    
79
                Each <gmd:descriptiveKeywords> block should have one or more keywords in it
80
                with one thesaurus. So we render keywords from the same thesaurus together.
81
            -->
82

    
83
            
84
            <xsl:if test="//gmd:descriptiveKeywords">
85
                <div class="control-group">
86
                    <label class="control-label">Descriptive Keywords</label>
87
                    <div class="controls">
88
                        <div class="controls-well">
89
                            <xsl:for-each select="//gmd:descriptiveKeywords">
90
                                <xsl:call-template name="descriptive_keywords"/>
91
                            </xsl:for-each>
92
                        </div>
93
                    </div>
94
                </div>
95
            </xsl:if>
96
            
97

    
98
            <!-- TODO: otherEntities? -->
99

    
100
            <!-- Metadata Contact(s) -->
101
            <div class="control-group">
102
                <label class="control-label">Metadata Contacts</label>
103
                <div class="controls">
104
                    <div class="controls-well">
105
                        <xsl:apply-templates select="//gmd:contact" />
106
                    </div>
107
                </div>
108
            </div>
109

    
110
            <!-- Data Set Contact(s) -->
111
            <div class="control-group">
112
                <label class="control-label">Data Set Contacts</label>
113
                <div class="controls">
114
                    <div class="controls-well">
115
                        <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
116
                    </div>
117
                </div>
118
            </div>
119

    
120
            <!-- Cited responsible parties-->
121
            <div class="control-group">
122
                <label class="control-label">Associated Parties</label>
123
                <div class="controls">
124
                    <div class="controls-well">
125
                        <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
126
                    </div>
127
                </div>
128
            </div>
129

    
130
            <!-- Extent (geographic, temporal, vertical) -->
131
            <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
132
                <div class="control-group">
133
                    <label class="control-label">Extent</label>
134
                    <div class="controls">
135
                        <div class="controls-well">
136
                            <xsl:call-template name="extent" />
137
                        </div>
138
                    </div>
139
                </div>
140
            </xsl:for-each>
141

    
142
            <!-- TODO Methods -->
143

    
144
        </form>
145
    </xsl:template>
146

    
147
    <!-- General templates that didn't make it into the module-specific 
148
         stylesheets -->
149
    
150
    <!-- Alternate identifier -->
151
    <xsl:template name="alternateidentifier">
152
        <div class="control-group">
153
            <label class="control-label">Alternate Identifier</label>
154
            <div class="controls">
155
                <div class="controls-well">
156
                    <xsl:value-of select="./gmd:MD_Identifier/gmd:code/gmx:Anchor/text()" />
157
                </div>
158
            </div>
159
        </div>
160
    </xsl:template>
161

    
162
    
163
    <!-- descriptiveKewords -->
164
    <xsl:template name="descriptive_keywords">
165
        <div><strong>Type:</strong>&#xa0;<xsl:value-of select="./gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode/text()" /></div>
166
        <div><strong>Thesaurus:&#xa0;</strong><xsl:value-of select="./gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></div>
167

    
168
        <ul>
169
            <xsl:for-each select="./gmd:MD_Keywords/gmd:keyword">
170
                <li><xsl:apply-templates select="." /></li>                
171
            </xsl:for-each>
172
        </ul>
173
    </xsl:template>
174

    
175
    <!-- Contact -->
176
    <!-- TODO: Role-->
177
    <!-- TODO: ./gmd:contactInfo-->
178
    <xsl:template name="contact">
179
        <xsl:call-template name="ci_responsibleparty" />
180
    </xsl:template>
181

    
182

    
183
    <!-- High level templates -->
184
    
185
    <xsl:template match="gco:CharacterString">
186
        <xsl:value-of select="./text()" />
187
    </xsl:template>
188

    
189
    <xsl:template match="gmx:Anchor">
190
        <xsl:element name="a">
191
            <xsl:attribute name="href">
192
                <xsl:value-of select="./@xlink:href" />
193
            </xsl:attribute>
194
            <xsl:value-of select="./text()" />
195
        </xsl:element>
196
    </xsl:template>
197

    
198
</xsl:stylesheet>
(4-4/4)