Revision 10159
Added by Bryce Mecum over 7 years ago
isoroot.xsl | ||
---|---|---|
1 | 1 |
<?xml version="1.0"?> |
2 | 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"> |
|
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:xlink="http://www.w3.org/1999/xlink" version="1.0"> |
|
7 |
<xsl:import href="iso-md.xsl"/> |
|
8 |
<xsl:import href="iso-ci.xsl"/> |
|
9 |
<xsl:import href="iso-ex.xsl"/> |
|
10 |
<xsl:import href="iso-gco.xsl"/> |
|
11 |
<xsl:import href="iso-gmd.xsl"/> |
|
12 |
<xsl:import href="iso-gml.xsl"/> |
|
13 |
<xsl:import href="iso-gmx.xsl"/> |
|
14 |
<xsl:output method="html" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes" /> |
|
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 |
<!-- TODO: Cover gmd:identificationInfo/SV_ServiceIdentification --> |
|
19 |
<xsl:template match="*[local-name()='MD_Metadata'] | *[local-name()='MI_Metadata']"> |
|
20 |
<form class="form-horizontal"> |
|
21 |
<div class="control-group entity"> |
|
22 |
<h4>General</h4> |
|
23 |
<!-- fileIdentifier 1:1 --> |
|
24 |
<div class="control-group"> |
|
25 |
<label class="control-label">Identifier</label> |
|
26 |
<div class="controls"> |
|
27 |
<div class="controls-well"> |
|
28 |
<xsl:value-of select="//gmd:fileIdentifier/gco:CharacterString/text()" /> |
|
29 |
</div> |
|
30 |
</div> |
|
31 |
</div> |
|
32 |
<!-- TODO: language 1:1 --> |
|
33 |
<!-- TODO: characterSet 1:1 --> |
|
34 |
<!-- Parent Identifier 1:1 conditional --> |
|
35 |
<xsl:if test="//gmd:parentIdentifier"> |
|
36 |
<div class="control-group"> |
|
37 |
<label class="control-label">Parent Identifier</label> |
|
38 |
<div class="controls"> |
|
39 |
<div class="controls-well"> |
|
40 |
<xsl:value-of select="//gmd:parentIdentifier/gco:CharacterString/text()" /> |
|
41 |
</div> |
|
42 |
</div> |
|
43 |
</div> |
|
44 |
</xsl:if> |
|
45 |
<!-- TODO: hierarchyLevel 0:inf --> |
|
46 |
<!-- TODO: hierarchyLevelName 0:inf --> |
|
47 |
<!-- Alternate identifier(s) 0:inf--> |
|
48 |
<!-- gmd:identifier is an optional aprt of the CI_Citation element --> |
|
49 |
<xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier"> |
|
50 |
<div class="control-group"> |
|
51 |
<label class="control-label">Cited Identifier</label> |
|
52 |
<div class="controls"> |
|
53 |
<div class="controls-well"> |
|
54 |
<xsl:apply-templates /> |
|
55 |
</div> |
|
56 |
</div> |
|
57 |
</div> |
|
58 |
</xsl:for-each> |
|
59 |
<!-- Abstract 1:inf--> |
|
60 |
<xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:abstract"> |
|
61 |
<div class="control-group"> |
|
62 |
<label class="control-label">Abstract</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 |
<!-- Publication (dateStamp) date 1:1 --> |
|
71 |
<div class="control-group"> |
|
72 |
<label class="control-label">Publication Date</label> |
|
73 |
<div class="controls"> |
|
74 |
<div class="controls-well"> |
|
75 |
<xsl:apply-templates select="//gmd:dateStamp" /> |
|
76 |
</div> |
|
77 |
</div> |
|
78 |
</div> |
|
79 |
<!-- Topic Categories --> |
|
80 |
<xsl:if test="//gmd:topicCategory"> |
|
81 |
<div class="control-group"> |
|
82 |
<label class="control-label">Topic Categories</label> |
|
83 |
<div class="controls"> |
|
84 |
<div class="controls-well"> |
|
85 |
<table class="table table-condensed"> |
|
86 |
<thead> |
|
87 |
<tr> |
|
88 |
<th>Topic</th> |
|
89 |
</tr> |
|
90 |
</thead> |
|
91 |
<tbody> |
|
92 |
<xsl:for-each select="//gmd:topicCategory"> |
|
93 |
<tr> |
|
94 |
<td> |
|
95 |
<xsl:apply-templates /> |
|
96 |
</td> |
|
97 |
</tr> |
|
98 |
</xsl:for-each> |
|
99 |
</tbody> |
|
100 |
</table> |
|
101 |
</div> |
|
102 |
</div> |
|
103 |
</div> |
|
104 |
</xsl:if> |
|
105 |
<!-- Keywords |
|
7 | 106 |
|
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 | 107 |
Each <gmd:descriptiveKeywords> block should have one or more keywords in it |
111 | 108 |
with one thesaurus. So we render keywords from the same thesaurus together. |
112 | 109 |
--> |
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> |
|
110 |
<xsl:if test="//gmd:descriptiveKeywords"> |
|
111 |
<div class="control-group"> |
|
112 |
<label class="control-label">Descriptive Keywords</label> |
|
113 |
<div class="controls"> |
|
114 |
<div class="controls-well"> |
|
115 |
<xsl:for-each select="//gmd:descriptiveKeywords"> |
|
116 |
<xsl:apply-templates /> |
|
117 |
</xsl:for-each> |
|
118 |
</div> |
|
119 |
</div> |
|
120 |
</div> |
|
121 |
</xsl:if> |
|
122 | 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"> |
|
123 |
<div class="control-group entity"> |
|
124 |
<h4>People and Associated Parties</h4> |
|
125 |
<!-- Metadata Contact(s) 1:inf --> |
|
126 |
<div class="control-group"> |
|
127 |
<label class="control-label">Metadata Contact(s)</label> |
|
128 |
<div class="controls"> |
|
129 |
<div class="controls-well"> |
|
130 |
<xsl:for-each select="//gmd:contact"> |
|
131 |
<xsl:apply-templates /> |
|
132 |
</xsl:for-each> |
|
133 |
</div> |
|
134 |
</div> |
|
135 |
</div> |
|
136 |
<!-- Data Set Contact(s) --> |
|
137 |
<div class="control-group"> |
|
138 |
<label class="control-label">Data Set Contacts</label> |
|
139 |
<div class="controls"> |
|
140 |
<div class="controls-well"> |
|
141 |
<xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:pointOfContact" /> |
|
142 |
</div> |
|
143 |
</div> |
|
144 |
</div> |
|
145 |
<!-- Cited responsible parties--> |
|
146 |
<div class="control-group"> |
|
147 |
<label class="control-label">Associated Parties</label> |
|
148 |
<div class="controls"> |
|
149 |
<div class="controls-well"> |
|
150 |
<xsl:apply-templates select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty" /> |
|
151 |
</div> |
|
152 |
</div> |
|
153 |
</div> |
|
154 |
</div> |
|
155 |
<!-- TODO: otherEntities? --> |
|
156 |
<!-- Extent (geographic, temporal, vertical) --> |
|
157 |
<xsl:for-each select="//gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent"> |
|
136 | 158 |
<xsl:apply-templates /> |
137 |
</xsl:for-each> |
|
159 |
</xsl:for-each> |
|
160 |
<!-- TODO Methods --> |
|
161 |
<div class="control-group entity"> |
|
162 |
<h4>Other Information</h4> |
|
163 |
<!-- Data usage rights (resourceConstraints) --> |
|
164 |
<xsl:if test="//gmd:resourceConstraints"> |
|
165 |
<xsl:for-each select="//gmd:resourceConstraints"> |
|
166 |
<xsl:apply-templates /> |
|
167 |
</xsl:for-each> |
|
168 |
</xsl:if> |
|
138 | 169 |
</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 |
|
170 |
</form> |
|
171 |
</xsl:template> |
|
172 |
<!-- General, high-level templates --> |
|
173 |
<!-- TODO: Figure out how to do this: I want to capture the scenario where |
|
174 |
an element like gmd:individualName has no child gco:CharacterString or |
|
179 | 175 |
equivalent but has a nilReason attribute. --> |
180 |
<xsl:template match="*[not(*) and ./@nilReason]"> |
|
181 |
nilReason! |
|
182 |
<xsl:value-of select="@nilReason" /> |
|
183 |
</xsl:template> |
|
176 |
<xsl:template match="*[not(*) and ./@nilReason]"> nilReason! |
|
177 |
<xsl:value-of select="@nilReason" /> |
|
178 |
</xsl:template> |
|
184 | 179 |
</xsl:stylesheet> |
Also available in: Unified diff
Minor tweaks and code cleanup to ISO XSLT
- Renamed the folder once more to be more correct