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
  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" encoding="UTF-8"
17
      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
18
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
19
      indent="yes" />  
20

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

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

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

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

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

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

    
83
        <!--  Topic Categories -->
84
        <xsl:if test="//gmd:topicCategory">
85
          <div class="control-group">
86
            <label class="control-label">Topic Categories</label>
87
            <div class="controls">
88
              <div class="controls-well">
89
                <table class="table table-condensed">
90
                  <thead>
91
                    <tr>
92
                      <th>Topic</th>
93
                    </tr>
94
                  </thead>
95
                  <tbody>
96
                    <xsl:for-each select="//gmd:topicCategory">
97
                      <tr>
98
                        <td><xsl:apply-templates /></td>
99
                      </tr>
100
                    </xsl:for-each>
101
                  </tbody>
102
                </table>
103
              </div>
104
            </div>
105
          </div>
106
        </xsl:if>
107
    
108
        <!-- Keywords
109

    
110
            Each <gmd:descriptiveKeywords> block should have one or more keywords in it
111
            with one thesaurus. So we render keywords from the same thesaurus together.
112
        -->
113
        <xsl:if test="//gmd:descriptiveKeywords">
114
          <div class="control-group">
115
            <label class="control-label">Descriptive Keywords</label>
116
            <div class="controls">
117
              <div class="controls-well">
118
                <xsl:for-each select="//gmd:descriptiveKeywords">
119
                  <xsl:apply-templates />
120
                </xsl:for-each>
121
              </div>
122
            </div>
123
          </div>
124
        </xsl:if>
125
      </div>
126

    
127
      <div class="control-group entity">
128
        <h4>People and Associated Parties</h4>
129

    
130
        <!-- Metadata Contact(s) 1:inf -->
131
        <div class="control-group">
132
          <label class="control-label">Metadata Contact(s)</label>
133
          <div class="controls">
134
            <div class="controls-well">
135
              <xsl:for-each select="//gmd:contact">
136
                <xsl:apply-templates />
137
              </xsl:for-each>
138
            </div>
139
          </div>
140
        </div>
141

    
142
        <!-- Data Set Contact(s) -->
143
        <div class="control-group">
144
          <label class="control-label">Data Set Contacts</label>
145
          <div class="controls">
146
            <div class="controls-well">
147
              <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" />
148
            </div>
149
          </div>
150
        </div>
151

    
152
        <!-- Cited responsible parties-->
153
        <div class="control-group">
154
          <label class="control-label">Associated Parties</label>
155
          <div class="controls">
156
            <div class="controls-well">
157
              <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
158
            </div>
159
          </div>
160
        </div>
161
      </div>
162

    
163
      <!-- TODO: otherEntities? -->
164

    
165
      <!-- Extent (geographic, temporal, vertical) -->
166
      <xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent">
167
        <xsl:apply-templates />
168
      </xsl:for-each>
169

    
170
      <!-- TODO Methods -->
171

    
172
    </form>
173
  </xsl:template>
174

    
175
  <!-- General, high-level templates -->
176

    
177
  <!-- TODO: Figure out how to do this: I want to capture the scenario where
178
  an element like gmd:individualName has on child gco:CharacterString or 
179
  equivalent but has a nilReason attribute. -->
180
  <xsl:template match="*[not(*) and ./@nilReason]">
181
    nilReason!
182
    <xsl:value-of select="@nilReason" />
183
  </xsl:template>
184
</xsl:stylesheet>
(8-8/8)