1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="1.0" xmlns:wmc="http://www.opengis.net/context" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink" >
|
3
|
<!--
|
4
|
Description: Output the context title and abstract
|
5
|
Author: Mike Adair mike.adairATnrcan.gc.ca
|
6
|
Licence: LGPL as per: http://www.gnu.org/copyleft/lesser.html
|
7
|
Abstract.xsl,v 1.5 2004/06/25 17:59:38 madair1 Exp
|
8
|
|
9
|
-->
|
10
|
<xsl:output method="xml" encoding="utf-8"/>
|
11
|
|
12
|
<!-- The common params set for all widgets -->
|
13
|
<xsl:param name="lang">en</xsl:param>
|
14
|
<xsl:param name="widgetNode"/>
|
15
|
|
16
|
<xsl:template match="/">
|
17
|
<xsl:apply-templates select="wmc:ViewContext/wmc:General"/>
|
18
|
<xsl:apply-templates select="wmc:OWSContext/wmc:General"/>
|
19
|
</xsl:template>
|
20
|
|
21
|
|
22
|
<!-- Main html -->
|
23
|
<xsl:template match="wmc:General">
|
24
|
<xsl:param name="metadataUrl">
|
25
|
<xsl:value-of select="wmc:DescriptionURL/wmc:OnlineResource/@xlink:href"/>
|
26
|
</xsl:param>
|
27
|
<xsl:param name="logoUrl">
|
28
|
<xsl:value-of select="wmc:LogoURL/wmc:OnlineResource/@xlink:href"/>
|
29
|
</xsl:param>
|
30
|
<div>
|
31
|
<xsl:if test="$logoUrl">
|
32
|
<div style="float:right"><img src='{$logoUrl}' alt='{$logoUrl}'/></div>
|
33
|
</xsl:if>
|
34
|
<p>
|
35
|
<xsl:choose>
|
36
|
<xsl:when test="wmc:Abstract/@xml:lang">
|
37
|
<xsl:value-of select="wmc:Abstract[@xml:lang=$lang]"/>
|
38
|
</xsl:when>
|
39
|
<xsl:otherwise>
|
40
|
<xsl:value-of select="wmc:Abstract"/>
|
41
|
</xsl:otherwise>
|
42
|
</xsl:choose>
|
43
|
<!--br/><xsl:value-of select="{$widgetNode}/stylesheet"/-->
|
44
|
</p>
|
45
|
<p style="float:left; clear:left; padding-top:0px; margin-top:0px;">
|
46
|
<a href='{$metadataUrl}' title='{$metadataUrl}' target="moreInfo"><xsl:call-template name="moreInfo"/></a>
|
47
|
</p>
|
48
|
<p style="float:right; clear:right; padding-top:0px; margin-top:0px; font-weight: bold">
|
49
|
provided by: <xsl:value-of select="wmc:ContactInformation/wmc:ContactPersonPrimary/wmc:ContactOrganization"/>
|
50
|
</p>
|
51
|
</div>
|
52
|
</xsl:template>
|
53
|
|
54
|
<xsl:template match="text()|@*"/>
|
55
|
|
56
|
<xsl:template name="moreInfo">
|
57
|
<xsl:choose>
|
58
|
<xsl:when test="$lang='fr'">Lisez à propos de cette carte</xsl:when>
|
59
|
<xsl:otherwise>Read more about this map</xsl:otherwise>
|
60
|
</xsl:choose>
|
61
|
</xsl:template>
|
62
|
|
63
|
</xsl:stylesheet>
|
64
|
|