-
Notifications
You must be signed in to change notification settings - Fork 0
/
05_hierarchyLevel.xsl
100 lines (95 loc) · 5.52 KB
/
05_hierarchyLevel.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gmi="http://www.isotc211.org/2005/gmi" xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gss="http://www.isotc211.org/2005/gss"
xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gfc="http://www.isotc211.org/2005/gfc" xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:grp="http://www.altova.com/Mapforce/grouping"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="fn grp vmf xs xsi xsl xd" xmlns="http://www.isotc211.org/2005/gmi">
<xd:doc scope="stylesheet">
<xd:desc>
<xd:p>gpm2iso/05_hierarchyLevel.xsl</xd:p>
<xd:p><xd:b>Created on:</xd:b> Jan 3, 2017</xd:p>
<xd:p><xd:b>Author:</xd:b> mccre004</xd:p>
<xd:p></xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="gpm2GmdHierarchyLevel">
<xsl:variable name="Title" select="/GPM/Identification_Information[1]/Citation[1]/Title[1]"/>
<xsl:choose>
<xsl:when test="/GPM/Metadata_Reference_Information[1]/Metadata_Hierarchy_Level[1]">
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue"><xsl:value-of select="/GPM/Metadata_Reference_Information[1]/Metadata_Hierarchy_Level[1]"/></xsl:attribute>
<xsl:value-of select="/GPM/Metadata_Reference_Information[1]/Metadata_Hierarchy_Level[1]"/>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="contains($Title,'Series Information File')">
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue">series</xsl:attribute>
series
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="contains($Title,'TIGERweb')">
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue">service</xsl:attribute>
service
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="contains($Title,'REST Service')">
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue">service</xsl:attribute>
service
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="contains($Title,'Map')">
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue">mapDocument</xsl:attribute>
mapDocument
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="contains($Title,'Planned')">
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue">initiative</xsl:attribute>
initiative
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="gmd:hierarchyLevel">
<xsl:element name="gmd:MD_ScopeCode">
<xsl:attribute name="codeList">http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode</xsl:attribute>
<xsl:attribute name="codeListValue">dataset</xsl:attribute>
dataset
</xsl:element>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="/GPM/Metadata_Reference_Information/Metadata_Hierarchy_Level_Name">
<xsl:element name="gmd:hierarchyLevelName">
<xsl:element name="gco:CharacterString"><xsl:value-of select="/GPM/Metadata_Reference_Information/Metadata_Hierarchy_Level_Name"/></xsl:element>
</xsl:element>
</xsl:if>
</xsl:template>
</xsl:stylesheet>