Project

General

Profile

« Previous | Next » 

Revision 10049

Added by Bryce Mecum over 7 years ago

Improve output of ISO XSLT

View differences:

isoroot.xsl
12 12
    <xsl:import href="iso-ex.xsl"/>
13 13
    <xsl:import href="iso-md.xsl"/>
14 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

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

  
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()" />
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>
30 42
                </div>
31 43
            </div>
32
        </div>
33 44

  
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>
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>
38 49

  
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()" />
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>
45 57
                </div>
46 58
            </div>
47
        </div>
48 59

  
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>
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>
59 73
                </div>
60
            </div>
61
        </div>
74
            </xsl:if>
75
            
62 76

  
63
        <!-- Keywords
77
            <!-- Keywords
64 78

  
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
        -->
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
            -->
68 82

  
69
        <xsl:for-each select="//gmd:descriptiveKeywords">
70
            <xsl:call-template name="topiccategory"/>
71
        </xsl:for-each>
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
            
72 97

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

  
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" />
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>
81 107
                </div>
82 108
            </div>
83
        </div>
84 109

  
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" />
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>
91 117
                </div>
92 118
            </div>
93
        </div>
94 119

  
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">
120
            <!-- Cited responsible parties-->
107 121
            <div class="control-group">
108
                <label class="control-label">Extent</label>
122
                <label class="control-label">Associated Parties</label>
109 123
                <div class="controls">
110 124
                    <div class="controls-well">
111
                        <xsl:call-template name="extent" />
125
                        <xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" />
112 126
                    </div>
113 127
                </div>
114 128
            </div>
115
        </xsl:for-each>
116 129

  
117
        <!-- TODO Methods -->
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>
118 141

  
142
            <!-- TODO Methods -->
143

  
119 144
        </form>
120 145
    </xsl:template>
121 146

  
......
135 160
    </xsl:template>
136 161

  
137 162
    
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>
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>
149 167

  
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>
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>
161 173
    </xsl:template>
162 174

  
163 175
    <!-- Contact -->

Also available in: Unified diff