home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / CdAtlasLib.jar / WorldData.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2006-06-20  |  9.5 KB  |  225 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:import href="BaseAtlas.xsl"/>
  11.  
  12.  <xsl:output method="xhtml" omit-xml-declaration="yes" indent="yes" encoding="UTF-8"/>
  13.  
  14.  
  15.  <xsl:variable name="thumbURL">ebcid:com.britannica.oec2.identifier.ThumbBinaryIdentifier</xsl:variable>
  16.  <xsl:variable name="imageURL">ebcid:com.britannica.oec2.identifier.FullBinaryIdentifier</xsl:variable>
  17.  
  18.  <!-- Moved down to this level since header size is different per page -->
  19. <xsl:template name="additionalResources">       
  20.    <script type="text/javascript" src="js/atlas.js"></script>
  21.    <link rel="StyleSheet" HREF="css/WorldData.css" TYPE="text/css"/>
  22. </xsl:template>
  23.  
  24.  <xsl:template match="/">
  25.            <xsl:call-template name="pageTemplate">
  26.                <xsl:with-param name="pageTitle"><xsl:value-of select="world_data/wd_title"/></xsl:with-param>
  27.                <xsl:with-param name="pageSubheading"></xsl:with-param>
  28.                <xsl:with-param name="pageHeading"><i>World Data: </i><xsl:value-of select="world_data/wd_title"/></xsl:with-param> 
  29.                <xsl:with-param name="pageBody"><xsl:apply-templates select="world_data"/></xsl:with-param>              
  30.            </xsl:call-template>
  31.  </xsl:template>
  32.  
  33.  <xsl:template match="world_data">
  34.      <!-- this is the call to baseatlas head --> 
  35.         
  36.         <table width="100%" cellpadding="0" cellspacing="10" border="0">
  37.             <tr>
  38.             <xsl:if test="profileAsset/asset">
  39.                            <td valign="top"><table width="80%" cellpadding="0" cellspacing="0">
  40.                              <tr><td class="subgrey"><img src="img/dot.gif" height="5" width="195"/></td></tr>
  41.                              <tr><td class="searchgrey" valign="top" align="center"><br/><xsl:apply-templates select="profileAsset" mode="thumb"/></td></tr>
  42.                            </table></td>
  43.             </xsl:if>
  44.             <xsl:if test="stat">
  45.                 <td valign="top"><table width="100%" cellpadding="0" cellspacing="0" border="0">
  46.                 <tr height="14"><td height="14" valign="middle" class="searchblu" colspan="4"><img src="img/bcd06_wd_arrow_blue_big.png"/><img src="img/dot.gif" width="5" height="5"/><font class="wdTitle">Profile</font></td></tr>
  47.                 <tr><td colspan="4"><img src="img/dot.gif" width="2" height="8"/></td></tr>
  48.                 <tr><td colspan="4" class="subgrey"><img src="img/dot.gif" width="2" height="1"/></td></tr>
  49.                     <xsl:for-each select="stat">
  50.                     <xsl:variable name="tdColor">
  51.                         <xsl:choose>
  52.                             <xsl:when test="(position() mod 2) = 1">#E5E5E5</xsl:when>
  53.                             <xsl:otherwise>white</xsl:otherwise>
  54.                         </xsl:choose>
  55.                     </xsl:variable>
  56.                     <tr><td colspan="4" bgcolor="{$tdColor}"><img src="img/dot.gif" width="2" height="3"/></td></tr>
  57.                     <tr bgcolor="{$tdColor}"><td width="5" align="left"><img src="img/dot.gif" height="5"/></td>
  58.                         <td class="wdTextBold" align="left"><xsl:apply-templates select="term" mode="display"/></td>
  59.                         <td width="10" align="left"><img src="img/dot.gif" height="5"/></td>
  60.                         <td align="left" class="wdText"><xsl:apply-templates select="value" mode="display"/></td>
  61.                     </tr>
  62.                     <tr><td colspan="4" bgcolor="{$tdColor}"><img src="img/dot.gif" width="2" height="3"/></td></tr>
  63.                     </xsl:for-each>
  64.                     <tr><td colspan="4" class="subgrey"><img src="img/dot.gif" width="2" height="1"/></td></tr>
  65.                                 
  66.                 <xsl:if test="ftnote"> 
  67.                    <xsl:apply-templates select="ftnote" mode="summary"/>
  68.                 </xsl:if>
  69.                 <tr><td colspan="4"><img src="img/dot.gif" width="2" height="10"/></td></tr>
  70.                 
  71.             </table></td>
  72.         </xsl:if></tr>
  73.         <xsl:if test="atlasFacts">
  74.             <xsl:apply-templates/>        
  75.         </xsl:if>        
  76.        </table>
  77.        
  78.        
  79.    
  80.  </xsl:template>
  81.  
  82.  <xsl:template match="profileAsset" mode="thumb">
  83.      <xsl:for-each select="asset">
  84.        <xsl:choose>
  85.               <xsl:when test="@type = 'locator'">
  86.              <img><xsl:attribute name="src"><xsl:value-of select="$imageURL"/>?binaryId==<xsl:value-of select="."/></xsl:attribute></img><br/><br/>
  87.            </xsl:when>
  88.           <xsl:otherwise>
  89.              <img><xsl:attribute name="src"><xsl:value-of select="$thumbURL"/>?binaryId==<xsl:value-of select="."/></xsl:attribute></img><br/><br/>
  90.            </xsl:otherwise>
  91.       </xsl:choose>
  92.      </xsl:for-each>
  93.  </xsl:template>
  94.  
  95.  <xsl:template match="asset"/>
  96.  
  97. <xsl:template match="wd_title" mode="display">
  98.     <xsl:apply-templates/>
  99. </xsl:template>
  100.  
  101. <xsl:template match="wd_title"/>
  102.  
  103. <xsl:template match="titltxt"/>
  104.  
  105. <xsl:template match="term" mode="display">
  106.     <xsl:apply-templates/>
  107. </xsl:template>
  108.  
  109. <xsl:template match="term"/>
  110.  
  111. <xsl:template match="value" mode="display">
  112.     <xsl:apply-templates/>
  113. </xsl:template>
  114.  
  115. <xsl:template match="value"/>
  116.  
  117. <xsl:template match="atlasFacts">
  118.     <tr><td colspan="3"><table width="100%" cellpadding="0" cellspacing="0" border="0">
  119.     
  120.     <xsl:for-each select="category">
  121.             <tr><td colspan="4"><img src="img/dot.gif" width="2" height="8"/></td></tr>
  122.             <tr height="14"><td height="14" valign="middle" class="searchblu" colspan="4"><img src="img/bcd06_wd_arrow_blue_big.png"/><img src="img/dot.gif" width="5" height="5"/><font class="wdTitle"><xsl:value-of select="@categoryName"/></font></td></tr>
  123.             <tr><td colspan="4"><img src="img/dot.gif" width="2" height="8"/></td></tr>
  124.             <tr><td colspan="4" class="subgrey"><img src="img/dot.gif" width="2" height="1"/></td></tr>
  125.             <xsl:for-each select="fact">
  126.             <xsl:variable name="tdColor">
  127.                         <xsl:choose>
  128.                             <xsl:when test="(position() mod 2) = 1">#E5E5E5</xsl:when>
  129.                             <xsl:otherwise>white</xsl:otherwise>
  130.                         </xsl:choose>
  131.             </xsl:variable>
  132.             <tr><td colspan="4" bgcolor="{$tdColor}"><img src="img/dot.gif" width="2" height="3"/></td></tr>
  133.             <tr bgcolor="{$tdColor}">
  134.                 <td width="10" align="left"><img src="img/dot.gif" height="5"/></td>
  135.                 <td width="300" class="wdTextBold"><xsl:apply-templates select="displayName"/><sup><xsl:apply-templates select="footnote" mode="count" /></sup><img src="img/dot.gif" height="5"/></td>
  136.                 
  137.                 <td class="wdText" width="*" align="right"><xsl:if test="number(displayValue/@yearLow) > 0">(<xsl:value-of select="displayValue/@yearLow"/><xsl:if test="number(displayValue/@yearHigh) > 0">-<xsl:value-of select="displayValue/@yearHigh"/></xsl:if>)</xsl:if><img src="img/dot.gif" height="5"/><img src="img/dot.gif" height="5"/><img src="img/dot.gif" height="5"/></td>
  138.                 <td class="wdText" width="*" align="left">
  139.                    <xsl:choose>
  140.                      <xsl:when test="displayValue='---' or displayValue='...'">
  141.                         <xsl:value-of select="displayValue"/> 
  142.                      </xsl:when>
  143.                      <xsl:otherwise>
  144.                         <xsl:value-of select="format-number(displayValue, '###,##0.0##')"/> 
  145.                      </xsl:otherwise>
  146.                  </xsl:choose></td></tr>
  147.             <tr><td colspan="4" bgcolor="{$tdColor}"><img src="img/dot.gif" width="2" height="3"/></td></tr>
  148.                     
  149.                 
  150.             </xsl:for-each>
  151.         <tr><td colspan="4" class="subgrey"><img src="img/dot.gif" width="2" height="1"/></td></tr>
  152.                         
  153.         </xsl:for-each>
  154.         <!-- display footnotes-->
  155.         <xsl:if test="count(descendant::footnote) > 0"> 
  156.            <xsl:for-each select="(descendant::fact)">
  157.                         <xsl:apply-templates select="footnote" mode="summary"/>
  158.                   </xsl:for-each>
  159.         </xsl:if>
  160.         <tr><td colspan="4"><img src="img/dot.gif" width="2" height="10"/></td></tr>                
  161.     </table></td></tr>    
  162.     <xsl:if test="count(descendant::category) > 0">
  163.             <tr bgcolor="#E5E5E5"><td colspan="3" class="wdTextBold">--- None, negligible or not applicable</td></tr>
  164.             <tr bgcolor="#E5E5E5"><td colspan="3" class="wdTextBold">... Not available</td></tr>
  165.         </xsl:if>
  166. </xsl:template>
  167.  
  168. <xsl:template match="footnote" mode="count">    
  169.     <xsl:text>(</xsl:text>
  170.     <xsl:value-of select="count(preceding::footnote) + 1"/>
  171.     <xsl:text>)</xsl:text>
  172. </xsl:template>
  173.  
  174.  
  175. <xsl:template match="footnote" mode="summary"> 
  176.     <tr bgcolor="#FFFFFF">
  177.     <td width="10" align="left"><img src="img/dot.gif" height="10"/></td>
  178.     <td order="0" class="wdText" align="left" width="100%" colspan="3"><xsl:text>(</xsl:text><xsl:value-of select="count(preceding::footnote) + 1"/><xsl:text>)</xsl:text><img src="img/dot.gif" height="5"/><img src="img/dot.gif" height="5"/><xsl:value-of select="(descendant-or-self::footnote)"/></td></tr>
  179. </xsl:template>
  180.  
  181.  <xsl:template name="atlasImage">
  182.    <xsl:param name="id"/>
  183.    <img src="ebcid:com.britannica.oec2.identifier.FullBinaryIdentifier?binaryId={$id}"/>
  184.  </xsl:template>
  185.  
  186.  <xsl:template name="atlasThumb">
  187.    <xsl:param name="id"/>
  188.    <img src="ebcid:com.britannica.oec2.identifier.ThumbBinaryIdentifier?binaryId={$id}"/>
  189.  </xsl:template>
  190.  
  191.  <xsl:template match="stat"> 
  192.     <xsl:apply-templates/>
  193.  </xsl:template>
  194.  
  195.   <xsl:template match="ftnote" mode="summary"> 
  196.     <tr bgcolor="#FFFFFF"><td width="10" align="left"><img src="img/dot.gif" height="10"/></td>
  197.     <td order="0" class="wdText" align="left" width="100%" colspan="3">
  198.         <img src="img/dot.gif" height="5"/><img src="img/dot.gif" height="5"/><xsl:apply-templates/></td></tr>
  199.   </xsl:template>
  200.  
  201.   <xsl:template match="ftnote" />
  202.  
  203.  
  204.  <xsl:template match="sup">
  205.    <sup><xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text></sup>
  206.  </xsl:template>
  207.  
  208.  <xsl:template match="sub">
  209.    <sub><xsl:apply-templates/></sub>
  210.  </xsl:template>
  211.  
  212.  <xsl:template match="frac">
  213.   <xsl:apply-templates/>
  214.  </xsl:template>
  215.  
  216.  <xsl:template match="num">
  217.    <xsl:apply-templates/><xsl:text>/</xsl:text>
  218.  </xsl:template>
  219.  
  220.  <xsl:template match="den">
  221.    <xsl:apply-templates/>
  222.  </xsl:template>
  223.  
  224. </xsl:stylesheet>
  225.