Project

General

Profile

metacat / lib / style / skins / metacatui / iso / isoroot.xsl @ 10046

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
    <!-- TODO: Figure out how to set the output method to get what I want -->
16
    <!-- TODO: ^ Figure out what I want to output -->
17
    <!-- TODO: Figuer out what this match statement should have in it -->
18
    <xsl:template match="/">
19

    
20
   	<form class="form-horizontal">
21
        <!-- Dataset title -->
22
        <span><xsl:value-of select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></span>
23

    
24
        <!-- Identifier -->
25
        <div class="control-group">
26
            <label class="control-label">Identifier</label>
27
            <div class="controls">
28
                <div class="controls-well">
29
                    <xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" />
30
                </div>
31
            </div>
32
        </div>
33

    
34
        <!-- Alternate identifier(s) -->
35
        <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier">
36
            <xsl:call-template name="alternateidentifier"/>
37
        </xsl:for-each>
38

    
39
        <!-- Abstract -->
40
        <div class="control-group">
41
            <label class="control-label">Abstract</label>
42
            <div class="controls">
43
                <div class="controls-well">
44
                    <xsl:value-of select="//gmd:abstract/gco:CharacterString/text()" />
45
                </div>
46
            </div>
47
        </div>
48

    
49
        <!--  Topic Categories -->
50
        <div class="control-group">
51
            <label class="control-label">Topic Categories</label>
52
            <div class="controls">
53
                <div class="controls-well">
54
                    <ul>
55
                        <xsl:for-each select="//gmd:topicCategory">
56
                            <li><xsl:value-of select="./gmd:MD_TopicCategoryCode/text()" /></li>                
57
                        </xsl:for-each>
58
                    </ul>
59
                </div>
60
            </div>
61
        </div>
62

    
63
        <!-- Keywords
64

    
65
            Each <gmd:descriptiveKeywords> block should have one or more keywords in it
66
            with one thesaurus. So we render keywords from the same thesaurus together.
67
        -->
68

    
69
        <xsl:for-each select="//gmd:descriptiveKeywords">
70
            <xsl:call-template name="topiccategory"/>
71
        </xsl:for-each>
72

    
73
        <!-- TODO: otherEntities? -->
74

    
75
        <!-- Metadata Contact(s) -->
76
        <div class="control-group">
77
            <label class="control-label">Metadata Contacts</label>
78
            <div class="controls">
79
                <div class="controls-well">
80
                    <xsl:apply-templates select="//gmd:contact" />
81
                </div>
82
            </div>
83
        </div>
84

    
85
        <!-- Data Set Contact(s) -->
86
        <div class="control-group">
87
            <label class="control-label">Data Set Contacts</label>
88
            <div class="controls">
89
                <div class="controls-well">
90
                    <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
91
                </div>
92
            </div>
93
        </div>
94

    
95
        <!-- Cited responsible parties-->
96
        <div class="control-group">
97
            <label class="control-label">Associated Parties</label>
98
            <div class="controls">
99
                <div class="controls-well">
100
                    <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
101
                </div>
102
            </div>
103
        </div>
104

    
105
        <!-- Extent (geographic, temporal, vertical) -->
106
        <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
107
            <div class="control-group">
108
                <label class="control-label">Extent</label>
109
                <div class="controls">
110
                    <div class="controls-well">
111
                        <xsl:call-template name="extent" />
112
                    </div>
113
                </div>
114
            </div>
115
        </xsl:for-each>
116

    
117
        <!-- TODO Methods -->
118

    
119
        </form>
120
    </xsl:template>
121

    
122
    <!-- General templates that didn't make it into the module-specific 
123
         stylesheets -->
124
    
125
    <!-- Alternate identifier -->
126
    <xsl:template name="alternateidentifier">
127
        <div class="control-group">
128
            <label class="control-label">Alternate Identifier</label>
129
            <div class="controls">
130
                <div class="controls-well">
131
                    <xsl:value-of select="./gmd:MD_Identifier/gmd:code/gmx:Anchor/text()" />
132
                </div>
133
            </div>
134
        </div>
135
    </xsl:template>
136

    
137
    
138
    <!-- Topic Category-->
139
    <!-- 
140
        TODO Type
141
        TODO Thesaurus
142
    -->
143
    <xsl:template name="topiccategory">
144
        <div class="control-group">
145
            <label class="control-label">Topic Categories</label>
146
            <div class="controls">
147
                <div class="controls-well">
148
                    <div>Type: <xsl:value-of select="./gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode/text()" /></div>
149

    
150
                    <!-- TODO: The rest of this CI_Citation element -->
151
                    <div>Thesaurus: <xsl:value-of select="./gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title/gco:CharacterString/text()" /></div>
152

    
153
                    <ul>
154
                        <xsl:for-each select="./gmd:MD_Keywords/gmd:keyword">
155
                            <li><xsl:apply-templates select="." /></li>                
156
                        </xsl:for-each>
157
                    </ul>
158
                </div>
159
            </div>
160
        </div>
161
    </xsl:template>
162

    
163
    <!-- Contact -->
164
    <!-- TODO: Role-->
165
    <!-- TODO: ./gmd:contactInfo-->
166
    <xsl:template name="contact">
167
        <xsl:call-template name="ci_responsibleparty" />
168
    </xsl:template>
169

    
170

    
171
    <!-- High level templates -->
172
    
173
    <xsl:template match="gco:CharacterString">
174
        <xsl:value-of select="./text()" />
175
    </xsl:template>
176

    
177
    <xsl:template match="gmx:Anchor">
178
        <xsl:element name="a">
179
            <xsl:attribute name="href">
180
                <xsl:value-of select="./@xlink:href" />
181
            </xsl:attribute>
182
            <xsl:value-of select="./text()" />
183
        </xsl:element>
184
    </xsl:template>
185

    
186
</xsl:stylesheet>