svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extMetadata / xslt / externalTemplates.xsl @ 28897
History | View | Annotate | Download (3.41 KB)
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
---|---|
2 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gmd="http://www.isotc211.org/2005/gmd" > |
3 |
|
4 |
<xsl:template name="convertDateTime"> |
5 |
<xsl:param name="param"/> |
6 |
<xsl:choose> |
7 |
<xsl:when test="contains($param, ' ')"> |
8 |
<xsl:value-of select="concat(substring-after($param,' '), 'T', substring-before($param,' '))"/> |
9 |
</xsl:when> |
10 |
<xsl:otherwise> |
11 |
<xsl:value-of select="$param"/> |
12 |
</xsl:otherwise> |
13 |
</xsl:choose> |
14 |
</xsl:template> |
15 |
|
16 |
<xsl:template name="convertDateTime115"> |
17 |
<xsl:param name="param"/> |
18 |
<xsl:choose> |
19 |
<xsl:when test="contains($param, 'T')"> |
20 |
<xsl:value-of select="concat(substring-after($param,'T'), ' ', substring-before($param,'T'))"/> |
21 |
</xsl:when> |
22 |
<xsl:otherwise> |
23 |
<xsl:value-of select="$param"/> |
24 |
</xsl:otherwise> |
25 |
</xsl:choose> |
26 |
</xsl:template> |
27 |
|
28 |
<xsl:template name="stringToReal"> |
29 |
<xsl:param name="param"/> |
30 |
<xsl:variable name="intValue" select="number($param)"/> |
31 |
<xsl:choose> |
32 |
<xsl:when test="contains($intValue, 'NaN')">0.0</xsl:when> |
33 |
<xsl:otherwise> |
34 |
<xsl:value-of select="$intValue"/> |
35 |
</xsl:otherwise> |
36 |
</xsl:choose> |
37 |
</xsl:template> |
38 |
|
39 |
<xsl:template name="stringToInteger"> |
40 |
<xsl:param name="param"/> |
41 |
<xsl:variable name="intValue" select="round($param)"/> |
42 |
<xsl:choose> |
43 |
<xsl:when test="contains($intValue, 'NaN')">0</xsl:when> |
44 |
<xsl:otherwise> |
45 |
<xsl:value-of select="$intValue"/> |
46 |
</xsl:otherwise> |
47 |
</xsl:choose> |
48 |
</xsl:template> |
49 |
|
50 |
<xsl:template name="codeListElement19139"> |
51 |
<xsl:param name="param"/> |
52 |
<xsl:param name="listName"/> |
53 |
<xsl:param name="namespace"/> |
54 |
<xsl:element name="{concat($namespace, ':', $listName)}" > |
55 |
<xsl:variable name="codeListValue" select="document('lists.xml')/*/list[@name=$listName]/element[@code=$param]" /> |
56 |
<xsl:attribute name="codeList"> |
57 |
<xsl:value-of select="concat('./resources/codeList.xml#', $listName)"/> |
58 |
</xsl:attribute> |
59 |
<xsl:attribute name="codeListValue"> |
60 |
<xsl:value-of select="$codeListValue" /> |
61 |
</xsl:attribute> |
62 |
<xsl:value-of select="$codeListValue" /> |
63 |
</xsl:element> |
64 |
</xsl:template> |
65 |
|
66 |
<xsl:template name="putTopicCategory"> |
67 |
<xsl:param name="param"/> |
68 |
<xsl:param name="listName"/> |
69 |
<xsl:param name="namespace"/> |
70 |
<xsl:element name="{concat($namespace, ':', $listName)}" > |
71 |
<xsl:variable name="codeListValue" select="document('lists.xml')/*/list[@name=$listName]/element[@code=$param]" /> |
72 |
<xsl:value-of select="$codeListValue" /> |
73 |
</xsl:element> |
74 |
</xsl:template> |
75 |
|
76 |
<xsl:template name="codeListElement19115"> |
77 |
<xsl:param name="param"/> |
78 |
<xsl:value-of select="*" /> |
79 |
</xsl:template> |
80 |
|
81 |
<xsl:template name="putValue"> |
82 |
<xsl:param name="param"/> |
83 |
<xsl:param name="value"/> |
84 |
<xsl:value-of select="$value" /> |
85 |
</xsl:template> |
86 |
|
87 |
<xsl:template name="generateIdVerticalCS">verticalCS<xsl:value-of select="generate-id()" /></xsl:template> |
88 |
|
89 |
<xsl:template name="generateIdCoordinateSystemAxis">coordinateSystemAxis<xsl:value-of select="generate-id()" /></xsl:template> |
90 |
|
91 |
<xsl:template name="generateIdVerticalDatum">verticalDatum<xsl:value-of select="generate-id()" /></xsl:template> |
92 |
|
93 |
<xsl:template name="generateIdVerticalCRS">verticalCRS<xsl:value-of select="generate-id()" /></xsl:template> |
94 |
|
95 |
</xsl:stylesheet> |
96 |
|