home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / oec2-lib.jar / xsl / shared / Variables.xsl < prev   
Encoding:
Extensible Markup Language  |  2006-08-25  |  1.8 KB  |  57 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:html="http://www.w3.org/TR/html4/loose.dtd"
  6.     exclude-result-prefixes="html"
  7.     version="1.0">
  8.  
  9.   <xsl:output method="html" encoding="UTF-8"/>
  10.  
  11.  
  12.   <!-- undefined special characters are underlined -->
  13.   <xsl:template match="charundef">
  14.     <u><xsl:value-of select="@char"/></u>
  15.   </xsl:template>
  16.  
  17.   <!-- some special characters must have a certain emphasis -->
  18.   <xsl:template match="charemph">
  19.     <xsl:choose>
  20.       <xsl:when test="@ty='i'"><i><xsl:value-of select="@char"/></i></xsl:when>
  21.       <xsl:when test="@ty='s'"><font size="-1" class="smallText"><xsl:value-of select="@char"/></font></xsl:when>
  22.       <xsl:when test="@ty='b'"><b><xsl:value-of select="@char"/></b></xsl:when>
  23.       <xsl:when test="@ty='bi'"><b><i><xsl:value-of select="@char"/></i></b></xsl:when>
  24.     </xsl:choose>
  25.   </xsl:template>
  26.  
  27.   <!-- some special characters must be in a special font -->
  28.   <xsl:template name="charfont">
  29.     <xsl:param name="font"></xsl:param>
  30.     <xsl:param name="char"></xsl:param>
  31.     <font face="{$font}"><xsl:value-of disable-output-escaping="yes" select="$char"/></font>
  32.   </xsl:template>
  33.  
  34.   <xsl:template match="charfont">
  35.     <font face="{@font}"><xsl:value-of select="@char"/></font>
  36.   </xsl:template>
  37.  
  38.  <!-- charimg tag has not been handled before. This causes some gifs not being displayed from the site. ex eu=57742. the tag is the result of entity mapping. -->
  39.  
  40.  <xsl:template match="charimg">
  41.    <xsl:variable name="gif">
  42.        <xsl:value-of select="@src"/>
  43.    </xsl:variable>
  44.  
  45.    <xsl:variable name="fn">
  46.     <xsl:value-of select="concat('/bcom/gifs/',$gif)"/>
  47.    </xsl:variable>
  48.  
  49.    <img>
  50.      <xsl:attribute name="src">
  51.        <xsl:value-of select="$fn"/>
  52.      </xsl:attribute>
  53.    </img>
  54. </xsl:template>
  55.  
  56. </xsl:stylesheet>
  57.