1
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2
|
|
3
|
<!--
|
4
|
Description: parses an OGC context collection document to generate a context pick list
|
5
|
Author: adair
|
6
|
Licence: LGPL as specified in http://www.gnu.org/copyleft/lesser.html .
|
7
|
|
8
|
$Id$
|
9
|
$Name$
|
10
|
-->
|
11
|
|
12
|
<xsl:stylesheet version="1.0"
|
13
|
xmlns:wmc="http://www.opengis.net/context"
|
14
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
15
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
16
|
exclude-result-prefixes="wmc xlink">
|
17
|
|
18
|
<xsl:output method="xml" omit-xml-declaration="yes" encoding="utf-8"/>
|
19
|
<xsl:strip-space elements="*"/>
|
20
|
|
21
|
<!-- The common params set for all widgets -->
|
22
|
<xsl:param name="lang">en</xsl:param>
|
23
|
|
24
|
<!-- Text params for this widget -->
|
25
|
<xsl:param name="title"/>
|
26
|
|
27
|
<!-- The coordinates of the DHTML Layer on the HTML page -->
|
28
|
<!-- xsl:param name="jsfunction">config.loadModel('</xsl:param -->
|
29
|
<xsl:param name="jsfunction">modelSwitcher('</xsl:param>
|
30
|
<xsl:param name="targetModel"/>
|
31
|
|
32
|
<!-- template rule matching source root element -->
|
33
|
<xsl:template match="/wmc:ViewContextCollection">
|
34
|
|
35
|
<ul>
|
36
|
<xsl:apply-templates select="wmc:ViewContextReference"/>
|
37
|
</ul>
|
38
|
|
39
|
</xsl:template>
|
40
|
|
41
|
<xsl:template match="wmc:ViewContextReference">
|
42
|
<xsl:param name="linkUrl">javascript:<xsl:value-of select="$jsfunction"/><xsl:value-of select="$targetModel"/>','<xsl:value-of select="wmc:ContextURL/wmc:OnlineResource/@xlink:href"/>')</xsl:param>
|
43
|
<xsl:param name="name"><xsl:value-of select='wmc:Title'/></xsl:param>
|
44
|
<input type='button' value="{$name}" onClick="{$linkUrl}" />
|
45
|
</xsl:template>
|
46
|
|
47
|
</xsl:stylesheet>
|