pylucene 3.5.0-3
[pylucene.git] / lucene-java-3.5.0 / lucene / src / site / src / documentation / skins / common / xslt / html / renderlogo.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
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
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
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.
17 -->
18 <!--
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.
22
23 Note that text and image are mandatory parts of the template.
24 -->
25 <xsl:stylesheet
26   version="1.0"
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}">
36     <xsl:choose>
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"/>
42             </xsl:if>
43             <xsl:value-of select="$logo"/>
44           </xsl:attribute>
45           <xsl:if test="$width">
46             <xsl:attribute name="width">
47               <xsl:value-of select="$width"/>
48             </xsl:attribute>
49           </xsl:if>
50           <xsl:if test="$height">
51             <xsl:attribute name="height">
52               <xsl:value-of select="$height"/>
53             </xsl:attribute>
54           </xsl:if>
55           <xsl:if test="$description">
56             <xsl:attribute name="title">
57               <xsl:value-of select="$description"/>
58             </xsl:attribute>
59           </xsl:if>
60         </img>
61       </xsl:when>
62       <xsl:otherwise>
63         <xsl:value-of select="$name"/>
64       </xsl:otherwise>
65     </xsl:choose></a>
66   </xsl:template>
67 </xsl:stylesheet>