home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Lucene example source code file (renderlogo.xsl)

This example Lucene source code file (renderlogo.xsl) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Lucene tags/keywords

apache, as, asf, asf, conditions, license, license, see, software, the, the, without, you, you

The Lucene renderlogo.xsl source code

<?xml version="1.0" encoding="utf-8"?>
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at


  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  See the License for the specific language governing permissions and
  limitations under the License.
A simple callable template that renders a logo for an entity. The logo will 
be a hyperlink and may include an image (with width and height if specified)
or else it will just include the specified text.

Note that text and image are mandatory parts of the template.
  <xsl:template name="renderlogo">
    <xsl:param name="name"/>
    <xsl:param name="url"/>
    <xsl:param name="logo"/>
    <xsl:param name="width"/>
    <xsl:param name="height"/>
    <xsl:param name="root"/>
    <xsl:param name="description"/>
      <xsl:when test="$logo and not($logo = '')">
        <img alt="{$name}" class="logoImage">
          <xsl:attribute name="src">
            <xsl:if test="not(starts-with($logo, 'http://'))">
              <xsl:value-of select="$root"/>
            <xsl:value-of select="$logo"/>
          <xsl:if test="$width">
            <xsl:attribute name="width">
              <xsl:value-of select="$width"/>
          <xsl:if test="$height">
            <xsl:attribute name="height">
              <xsl:value-of select="$height"/>
          <xsl:if test="$description">
            <xsl:attribute name="title">
              <xsl:value-of select="$description"/>
        <xsl:value-of select="$name"/>

Other Lucene examples (source code examples)

Here is a short list of links related to this Lucene renderlogo.xsl source code file:

my book on functional programming


new blog posts


Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.