1 <?xml version="1.0" encoding="utf-8"?>
3 Licensed to the Apache Software Foundation (ASF) under one or more
4 contributor license agreements. See the NOTICE file distributed with
5 this work for additional information regarding copyright ownership.
6 The ASF licenses this file to You under the Apache License, Version 2.0
7 (the "License"); you may not use this file except in compliance with
8 the License. You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
19 A simple callable template that renders a logo for an entity. The logo will
20 be a hyperlink and may include an image (with width and height if specified)
21 or else it will just include the specified text.
23 Note that text and image are mandatory parts of the template.
27 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
28 <xsl:template name="renderlogo">
29 <xsl:param name="name"/>
30 <xsl:param name="url"/>
31 <xsl:param name="logo"/>
32 <xsl:param name="width"/>
33 <xsl:param name="height"/>
34 <xsl:param name="root"/>
35 <xsl:param name="description"/><a href="{$url}">
37 <xsl:when test="$logo and not($logo = '')">
38 <img alt="{$name}" class="logoImage">
39 <xsl:attribute name="src">
40 <xsl:if test="not(starts-with($logo, 'http://'))">
41 <xsl:value-of select="$root"/>
43 <xsl:value-of select="$logo"/>
45 <xsl:if test="$width">
46 <xsl:attribute name="width">
47 <xsl:value-of select="$width"/>
50 <xsl:if test="$height">
51 <xsl:attribute name="height">
52 <xsl:value-of select="$height"/>
55 <xsl:if test="$description">
56 <xsl:attribute name="title">
57 <xsl:value-of select="$description"/>
63 <xsl:value-of select="$name"/>