home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / CdAtlasLib.jar / AtlasProfile.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2006-06-20  |  3.9 KB  |  133 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.        xmlns:xhtml="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  7.        exclude-result-prefixes="html xhtml"
  8.        version="1.0">
  9.  
  10.  <xsl:output method="xhtml" omit-xml-declaration="yes" indent="yes" encoding="UTF-8"/>
  11.  
  12.  <!-- passed in by the caller -->
  13.  <xsl:param name="LOCATOR_ASSET_ID"/>
  14.  <xsl:param name="GRAPH_ASSET_ID"/>
  15.  <xsl:param name="FLAG_ASSET_ID"/>
  16.  
  17.  <!-- NOTE: DTD mentions xref elements, but this stylesheet does not yet support them -->
  18.  
  19.  <!-- Document Root -->
  20.  <xsl:template match="/">
  21.    <html>
  22.      <head></head>
  23.      <body  leftmargin="0" rightmargin="0">
  24.  
  25.        <table cols="2" width="110" border="0">
  26.          <tr>
  27.            <td colspan="2">
  28.              <table width="110" cols="2" border="0" cellpadding="0" cellspacing="0" align="left">
  29.                <tr>
  30.                  <td width="60">
  31.                    <xsl:call-template name="LOCATOR_ASSET_ID"/>
  32.                  </td>
  33.                  <td width="50">
  34.                    <xsl:call-template name="FLAG_ASSET_ID"/>
  35.                  </td>
  36.                </tr>
  37.              </table>
  38.            </td>
  39.          </tr>
  40.     
  41.          <xsl:apply-templates select="//stat"/>
  42.        </table>
  43.        
  44.          <xsl:apply-templates select="//ftnote"/>
  45.        </body>
  46.    </html>
  47.  </xsl:template>
  48.  
  49.  <!-- we show the title elsewhere -->
  50.  <xsl:template match="title"/>
  51.  
  52.  <xsl:template name="LOCATOR_ASSET_ID">
  53.     <xsl:call-template name="atlasImage">
  54.         <xsl:with-param name="id">
  55.             <xsl:value-of select="$LOCATOR_ASSET_ID"/>
  56.         </xsl:with-param>
  57.     </xsl:call-template>
  58.  </xsl:template>  
  59.  
  60.  <xsl:template name="GRAPH_ASSET_ID">
  61.     <xsl:call-template name="atlasImage">
  62.         <xsl:with-param name="id">
  63.             <xsl:value-of select="$GRAPH_ASSET_ID"/>
  64.         </xsl:with-param>
  65.     </xsl:call-template>
  66.  </xsl:template>  
  67.  
  68.  <xsl:template name="FLAG_ASSET_ID">
  69.          <xsl:call-template name="atlasThumb">
  70.            <xsl:with-param name="id">
  71.              <xsl:value-of select="$FLAG_ASSET_ID"/>
  72.            </xsl:with-param>
  73.          </xsl:call-template>
  74.  </xsl:template>  
  75.  
  76.  <xsl:template name="atlasImage">
  77.    <xsl:param name="id"/>
  78.    <img src="ebcid:com.britannica.oec2.identifier.FullBinaryIdentifier?binaryId={$id}"/>
  79.  </xsl:template>
  80.  
  81.  <xsl:template name="atlasThumb">
  82.    <xsl:param name="id"/>
  83.    <img src="ebcid:com.britannica.oec2.identifier.ThumbBinaryIdentifier?binaryId={$id}"/>
  84.  </xsl:template>
  85.  
  86.  <xsl:template match="stat"> 
  87.      <xsl:call-template name="profileEntry"/>
  88.  </xsl:template>
  89.  
  90.  <xsl:template name="profileEntry">
  91.      <tr>
  92.        <td align="right" width="60"><font size="10"><b><i><xsl:apply-templates select="term"/></i></b></font></td>
  93.        <td align="left" width="50"><font size="10"><xsl:apply-templates select="value"/></font></td> 
  94.      </tr>
  95.  </xsl:template>
  96.  
  97.  <xsl:template match="ftnote">
  98.      <p width="110">
  99.        <font size="10"><xsl:apply-templates/></font>
  100.      </p>
  101.      </xsl:template>
  102.  
  103.  <xsl:template match="sup">
  104.    <sup><xsl:apply-templates/></sup>
  105.  </xsl:template>
  106.  
  107.  <xsl:template match="sub">
  108.    <sub><xsl:apply-templates/></sub>
  109.  </xsl:template>
  110.  
  111.  <xsl:template match="frac">
  112.     <xsl:apply-templates select="num"/>/<xsl:apply-templates select="den"/>
  113.  </xsl:template>
  114.   
  115.  <xsl:template match="num | upper">
  116.   <sup><xsl:apply-templates/></sup>
  117.  </xsl:template>
  118.  
  119.  <xsl:template match="den | lower">
  120.   <sub><xsl:apply-templates/></sub>
  121.  </xsl:template>
  122.  
  123.   <xsl:template match="e">
  124.     <xsl:choose>
  125.       <xsl:when test="@ty='i'"><i><xsl:apply-templates/></i></xsl:when>
  126.       <xsl:when test="@ty='s'"><font size="-1"><xsl:apply-templates/></font></xsl:when>
  127.       <xsl:when test="@ty='u'"><u><xsl:apply-templates/></u></xsl:when>
  128.       <xsl:when test="@ty='bi'"><b><i><xsl:apply-templates/></i></b></xsl:when>
  129.     </xsl:choose>
  130.   </xsl:template>
  131.  
  132. </xsl:stylesheet>
  133.