Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet
3
  xmlns:mb="http://mapbuilder.sourceforge.net/mapbuilder" 
4
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
  exclude-result-prefixes="mb" version="1.0" >
6
<!--
7
Description: Convert Mapbuilder Config to a list of buttons.
8
Author:      Mike Adair
9
Licence:     LGPL as per: http://www.gnu.org/copyleft/lesser.html
10

    
11
ButtonBar.xsl,v 1.5 2004/03/25 21:25:43 madair1 Exp
12
 || mb:widgets/* || mb:tools/*
13
-->
14

    
15
  <xsl:output method="html" omit-xml-declaration="yes"/>
16
  
17
  <xsl:param name="baseDir">/mapbuilder/lib</xsl:param>
18
  
19
  <xsl:template match="/mb:MapbuilderConfig">
20
    <xsl:apply-templates />
21
  </xsl:template>
22
  
23
  <xsl:template match="mb:models/*">
24
    <xsl:variable name="scriptfile"><xsl:value-of select="$baseDir"/>/model/<xsl:value-of select="name(.)"/>.js</xsl:variable>
25
    <script type="text/javascript" src="{$scriptfile}"></script>
26
    <xsl:apply-templates />
27
  </xsl:template>
28
  
29
  <xsl:template match="mb:widgets/*">
30
    <xsl:variable name="scriptfile"><xsl:value-of select="$baseDir"/>/widget/<xsl:value-of select="name(.)"/>.js</xsl:variable>
31
    <script type="text/javascript" src="{$scriptfile}"></script>
32
    <xsl:apply-templates select="mb:scriptfile"/>
33
  </xsl:template>
34
  
35
  <xsl:template match="mb:tools/*">
36
    <xsl:variable name="scriptfile"><xsl:value-of select="$baseDir"/>/tool/<xsl:value-of select="name(.)"/>.js</xsl:variable>
37
    <script type="text/javascript" src="{$scriptfile}"></script>
38
  </xsl:template>
39
  
40
  <xsl:template match="mb:scriptfile">
41
    <xsl:variable name="scriptfile"><xsl:value-of select="."/></xsl:variable>
42
    <script type="text/javascript" src="{$scriptfile}"></script>
43
  </xsl:template>
44
  
45
  <xsl:template match="text()|@*"/>
46

    
47
</xsl:stylesheet>
(1-1/3)