Project

General

Profile

1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

    
3
<!--
4
Description: parses an OGC context document to generate an array of DHTML layers.
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:ows="http://www.opengis.net/ows"
15
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
16
    xmlns:xlink="http://www.w3.org/1999/xlink" exclude-result-prefixes="wmc xlink">
17

    
18
  <xsl:output method="xml"/>
19
  <xsl:strip-space elements="*"/>
20

    
21
  <!-- The coordinates of the DHTML Layer on the HTML page -->
22
  <xsl:param name="modelId"/>
23
  <xsl:param name="widgetId"/>
24
  <xsl:param name="selectName">resourceSelect</xsl:param>
25

    
26
  <!-- template rule matching source root element -->
27
  <xsl:template match="/wmc:OWSContext">
28
      <select name="{$selectName}" onchange="javascript:config.objects.{$widgetId}.selectResource(this.options[this.selectedIndex]);" >
29
        <option value="">Select a map resource</option>
30
        <xsl:apply-templates select="wmc:ResourceList/*"/>
31
      </select>
32
  </xsl:template>
33
  
34
  <!-- these handled outside of the stylesheet -->
35
  <xsl:template match="wmc:Coverage | wmc:FeatureType | wmc:Layer">
36
    <option>
37
      <xsl:attribute name="resourceType"><xsl:value-of select="wmc:Server/@service"/></xsl:attribute>
38
      <xsl:attribute name="value"><xsl:value-of select="wmc:Name"/></xsl:attribute>
39
      <b><xsl:value-of select="wmc:Server/@service"/></b> - <xsl:value-of select="wmc:Title"/>
40
    </option>
41
  </xsl:template>
42
  
43
</xsl:stylesheet>
(11-11/21)