home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / oec2-lib.jar / xsl / cd / TableContent.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-25  |  24.9 KB  |  526 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet 
  3.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.     xmlns:html="http://www.w3.org/TR/html4/loose.dtd"
  5.     xmlns:xhtml="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  6.     exclude-result-prefixes="html xhtml"
  7.     version="1.0">  
  8.     
  9.   <xsl:import href="shared/Variables.xsl"/>
  10.   <xsl:output method="xhtml" omit-xml-declaration="yes" indent="no" encoding="UTF-8"/>
  11.  
  12.   <xsl:param name="tocId"/>
  13.   <xsl:param name="articleId"/>
  14.   <xsl:param name="articleType"/>
  15.   <xsl:param name="library"/>
  16.   <xsl:variable name="tocExpand">Expand all</xsl:variable>
  17.   <xsl:variable name="tocCollapse">Collapse all</xsl:variable>
  18.   
  19.   <xsl:variable name="headingBgColor">
  20.       <xsl:choose>
  21.           <xsl:when test="$library = 'EB'">#538CC5</xsl:when>
  22.           <xsl:when test="$library = 'EBI'">#7AAA67</xsl:when>
  23.           <xsl:when test="$library = 'EBK'">#AC81C1</xsl:when>
  24.           <xsl:when test="$library = 'STANDARD'">#538CC5</xsl:when>          
  25.       </xsl:choose>
  26.   </xsl:variable>
  27.   <xsl:template match="toc">
  28. <SCRIPT language="JavaScript">
  29.   var plusImage = new Image();
  30.   plusImage.src = "img/toc_plus.gif"
  31.   
  32.   var minusImage = new Image();
  33.   minusImage.src = "img/toc_minus.gif"  
  34.  
  35.   function changeTocNode(tocId, imgId){
  36.      var leDiv = document.getElementById(tocId);
  37.      if (leDiv.style.display == "none") {
  38.          leDiv.style.display = "block";
  39.          document.getElementById(imgId).src = "img/toc_minus.gif";
  40.      } else {
  41.          leDiv.style.display = "none";
  42.          document.getElementById(imgId).src = "img/toc_plus.gif";
  43.      }
  44.      return true;
  45.   }
  46.  
  47.   function openAllTocNodes(){
  48.      document.getElementById("expand").className="tocnone";
  49.      document.getElementById("collapse").className="tocblock";     
  50.      var allDiv = document.getElementsByTagName("table");
  51.      var i;
  52.      for (i=0;i<xsl:text disable-output-escaping="yes"><</xsl:text>allDiv.length;i++) {
  53.         var thisDiv = allDiv[i]; 
  54.         if(thisDiv.id <xsl:text disable-output-escaping="yes">&&</xsl:text> thisDiv.id.indexOf('toc') != -1) {
  55.            thisDiv.style.display = "block";
  56.            var imgIdName = 'img' + thisDiv.id.substr(thisDiv.id.indexOf('c')+1);
  57.            document.getElementById(imgIdName).src = "img/toc_minus.gif";
  58.         }
  59.      }
  60.      return false;
  61.   }
  62.  
  63.   function collapseAllTocNodes(){
  64.      document.getElementById("collapse").className="tocnone";
  65.      document.getElementById("expand").className="tocblock";
  66.      var allDiv = document.getElementsByTagName("table");
  67.      var i;
  68.      for (i=0;i<xsl:text disable-output-escaping="yes"><</xsl:text>allDiv.length;i++) {
  69.         var thisDiv = allDiv[i]; 
  70.         if(thisDiv.id <xsl:text disable-output-escaping="yes">&&</xsl:text> thisDiv.id.indexOf('toc') != -1) {
  71.            thisDiv.style.display = "none";
  72.            var imgIdName = 'img' + thisDiv.id.substr(thisDiv.id.indexOf('c')+1);
  73.            document.getElementById(imgIdName).src = "img/toc_plus.gif";
  74.         }
  75.      }
  76.      return false;
  77.   }
  78.  
  79. </SCRIPT>
  80.  
  81. <table width="157" border="0" cellpadding="0" cellspacing="-2" bgcolor="#E5E5E5">
  82.     <tr><td colspan="3"><img src="img/dot.gif" height="16" width="1"/></td></tr>
  83.     <tr bgcolor="{$headingBgColor}">
  84.       <td><img src="img/dot.gif" height="1" width="4"/></td>
  85.       <td class="colorhead">This Article's<br/>Table of Contents</td>
  86.       <td><img src="img/dot.gif" height="1" width="4"/></td>
  87.     </tr>
  88.     <tr><td colspan="3"><img src="img/dot.gif" height="5" width="1"/></td></tr>
  89. </table>
  90.  
  91. <xsl:if test="count(//lv3) > 0">
  92. <table width="155" border="0" cellpadding="0" cellspacing="0" bgcolor="#E5E5E5">
  93.     <tr><td colspan="3"><img src="img/dot.gif" height="5" width="1"/></td></tr>
  94.     <tr>
  95.         <td><img src="img/dot.gif" height="1" width="10"/></td>
  96.         <td class="copy">
  97.             <div class="tocblock" id="expand"><a href="javascript:void(0)" onClick="openAllTocNodes()" class="copy"><xsl:value-of select="$tocExpand"/></a></div>
  98.             <div class="tocnone" id="collapse"><a href="javascript:void(0)" onClick="collapseAllTocNodes()" class="copy"><xsl:value-of select="$tocCollapse"/></a></div>
  99.             </td>
  100.         <td><img src="img/dot.gif" height="1" width="10"/></td>
  101.     </tr>
  102.     <xsl:if test="$tocId != lv1[position() = 1]/@tocid">
  103.         <tr><td colspan="3"><img src="img/dot.gif" height="5" width="1"/></td></tr>
  104.         <tr><td valign="top" colspan="3" background="img/tinydot.gif" height="1"><img src="img/dot.gif" height="1" width="151"/></td></tr>
  105.     </xsl:if>
  106.     <tr><td colspan="3"><img src="img/dot.gif" height="10" width="1"/></td></tr>
  107. </table>
  108. </xsl:if>
  109.  
  110. <table width="155" border="0" cellpadding="0" cellspacing="0" bgcolor="#E5E5E5">
  111.   <tr><td><xsl:apply-templates select="lv1"/></td></tr>
  112. </table>    
  113. </xsl:template>
  114.  
  115. <xsl:template match="lv1">
  116.   <xsl:choose>
  117.     <xsl:when test="$tocId = @tocid">
  118.       <table width="155" border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  119.         <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr>
  120.         <tr height="17">
  121.           <td width="10"><img src="img/arrow_red_r.gif" height="17" width="8"/></td>
  122.           <td width="14" valign="top" class="artcopy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  123.           <td width="117" valign="middle" class="copy">
  124.             <xsl:choose>
  125.               <xsl:when test="@seqnbr = 0 and count(/toc//headtitle) > 1">Introduction</xsl:when>
  126.               <xsl:otherwise>
  127.                 <xsl:if test="headtitle != 'null'">
  128.                   <xsl:apply-templates select="headtitle"/>
  129.                 </xsl:if>
  130.               </xsl:otherwise>
  131.             </xsl:choose>
  132.           </td>
  133.           <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  134.         </tr>
  135.         <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr> 
  136.       </table>
  137.     </xsl:when>
  138.     <xsl:otherwise>
  139.       <table width="155" border="0" cellpadding="0" cellspacing="0">
  140.         <tr height="17"><td width="10">
  141.           <img src="img/dot.gif" height="1" width="10"/></td>
  142.           <td width="14" valign="top" class="artcopy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  143.           <xsl:choose>
  144.             <xsl:when test="@has_content = 'true'">
  145.               <td width="117" valign="middle" class="copy">
  146.                 <a>
  147.                   <xsl:attribute name="href">
  148.                     <xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  149.                   </xsl:attribute>
  150.                   <xsl:attribute name="class">copy</xsl:attribute>
  151.                   <xsl:choose>
  152.                     <xsl:when test="@seqnbr = 0">Introduction</xsl:when>
  153.                     <xsl:otherwise>
  154.                       <xsl:if test="headtitle != 'null'">
  155.                         <xsl:apply-templates select="headtitle"/>
  156.                       </xsl:if>
  157.                     </xsl:otherwise>
  158.                   </xsl:choose>
  159.                 </a>
  160.               </td>
  161.             </xsl:when>
  162.             <xsl:otherwise>
  163.               <td width="117" valign="middle" class="copy">
  164.                 <xsl:attribute name="class">copy</xsl:attribute>
  165.                 <xsl:choose>
  166.                   <xsl:when test="@seqnbr = 0">Introduction</xsl:when>
  167.                   <xsl:otherwise>
  168.                     <xsl:if test="headtitle != 'null'"><xsl:apply-templates select="headtitle"/></xsl:if>
  169.                   </xsl:otherwise>
  170.                 </xsl:choose>
  171.               </td>
  172.             </xsl:otherwise>
  173.           </xsl:choose>
  174.           <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  175.         </tr>
  176.       </table>
  177.     </xsl:otherwise>
  178.   </xsl:choose>
  179.   <xsl:apply-templates select="lv2"/>
  180. </xsl:template>
  181.  
  182.  
  183. <xsl:template match="lv2">
  184.   <xsl:choose>
  185.    <xsl:when test="$tocId = @tocid">
  186.      <table width="155" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  187.       <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr> 
  188.       <xsl:choose>
  189.         <xsl:when test="lv3">
  190.           <tr height="17">
  191.             <td width="24"><img src="img/arrow_red_r.gif" height="17" width="8"/></td>
  192.             <td valign="top" width="14">
  193.               <img>
  194.                 <xsl:attribute name="id">img<xsl:value-of select="@tocid"/></xsl:attribute>
  195.                 <xsl:attribute name="height">9</xsl:attribute>
  196.                 <xsl:attribute name="width">9</xsl:attribute>
  197.                 <xsl:attribute name="src">img/toc_plus.gif</xsl:attribute>
  198.                 <xsl:attribute name="border">0</xsl:attribute>
  199.                 <xsl:attribute name="onClick">changeTocNode('toc<xsl:value-of select="@tocid"/>','img<xsl:value-of select="@tocid"/>')</xsl:attribute>
  200.                 <xsl:attribute name="style">cursor:hand</xsl:attribute>
  201.                 <xsl:attribute name="vspace">4</xsl:attribute>
  202.               </img>
  203.               <img src="img/dot.gif" height="1" width="4"/>
  204.             </td>
  205.             <xsl:choose>
  206.               <xsl:when test="@has_content = 'true'">
  207.                 <td width="103" valign="middle" class="copy">
  208.                   <a>
  209.                     <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  210.                     </xsl:attribute>
  211.                     <xsl:attribute name="class">copy</xsl:attribute>
  212.                     <xsl:if test="headtitle != 'null'">
  213.                       <xsl:apply-templates select="headtitle"/>
  214.                     </xsl:if>
  215.                   </a>
  216.                 </td>
  217.               </xsl:when>
  218.               <xsl:otherwise>
  219.                 <td width="103" valign="middle" class="copy">
  220.                   <xsl:attribute name="class">copy</xsl:attribute><!-- is this redundant? -->
  221.                   <xsl:if test="headtitle != 'null'">
  222.                     <xsl:apply-templates select="headtitle"/>
  223.                   </xsl:if>
  224.                 </td>
  225.               </xsl:otherwise>
  226.             </xsl:choose>
  227.             <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  228.           </tr>
  229.           <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr>
  230.           <tr>
  231.             <td colspan="4">
  232.               <table cellpadding="0" cellspacing="0" border="0" bgcolor="#EEEEEE" width="151">
  233.                 <xsl:attribute name="id">toc<xsl:value-of select="@tocid"/></xsl:attribute><!-- why not state these directly? -->
  234.                 <xsl:attribute name="style">display: none</xsl:attribute><!-- why not state these directly? -->
  235.                 <xsl:apply-templates select="lv3"/>
  236.               </table>
  237.             </td>
  238.           </tr>
  239.         </xsl:when>
  240.         <xsl:otherwise>
  241.           <tr height="17">
  242.             <td width="24"><img src="img/arrow_red_r.gif" height="17" width="8"/></td>
  243.             <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  244.             <td width="103" valign="middle" class="copy">
  245.               <xsl:if test="headtitle != 'null'"><xsl:apply-templates select="headtitle"/></xsl:if>
  246.             </td>
  247.             <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  248.           </tr>
  249.           <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr>
  250.         </xsl:otherwise>
  251.       </xsl:choose>
  252.     </table>
  253.   </xsl:when>
  254.   <xsl:otherwise>
  255.     <xsl:choose>
  256.       <xsl:when test="lv3">
  257.         <table border="0" cellspacing="0" cellpadding="0" width="155">
  258.           <tr height="17">
  259.             <td width="24"><img src="img/dot.gif" height="1" width="20"/></td>
  260.             <td valign="top" width="14">
  261.               <img>
  262.                 <xsl:attribute name="id">img<xsl:value-of select="@tocid"/></xsl:attribute>
  263.                 <xsl:attribute name="height">9</xsl:attribute>
  264.                 <xsl:attribute name="width">9</xsl:attribute>
  265.                 <xsl:attribute name="src">img/toc_plus.gif</xsl:attribute>
  266.                 <xsl:attribute name="border">0</xsl:attribute>
  267.                 <xsl:attribute name="onClick">changeTocNode('toc<xsl:value-of select="@tocid"/>','img<xsl:value-of select="@tocid"/>')</xsl:attribute>
  268.                 <xsl:attribute name="style">cursor:hand</xsl:attribute>
  269.                 <xsl:attribute name="vspace">4</xsl:attribute>
  270.               </img>
  271.               <img src="img/dot.gif" height="1" width="4"/>
  272.             </td>    
  273.             <xsl:choose>
  274.               <xsl:when test="@has_content = 'true'">
  275.                 <td width="103" valign="middle" class="copy">
  276.                   <a>
  277.                     <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  278.                     </xsl:attribute>
  279.                     <xsl:attribute name="class">copy</xsl:attribute>
  280.                     <xsl:if test="headtitle != 'null'">
  281.                       <xsl:apply-templates select="headtitle"/>
  282.                     </xsl:if>
  283.                   </a>
  284.                 </td>
  285.               </xsl:when>
  286.               <xsl:otherwise>
  287.                 <td width="103" valign="middle" class="copy">
  288.                   <xsl:attribute name="class">copy</xsl:attribute><!-- isn't this redundant? -->
  289.                   <xsl:if test="headtitle != 'null'"><xsl:apply-templates select="headtitle"/></xsl:if>
  290.                 </td>
  291.               </xsl:otherwise>
  292.             </xsl:choose>
  293.             <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  294.           </tr>
  295.         </table>
  296.         <table cellpadding="0" cellspacing="0" border="0" width="155">
  297.           <xsl:attribute name="id">toc<xsl:value-of select="@tocid"/></xsl:attribute>
  298.           <xsl:attribute name="style">display: none</xsl:attribute>
  299.           <xsl:apply-templates select="lv3">
  300.             <xsl:with-param name="parentTocId"><xsl:value-of select="@tocid"/></xsl:with-param>
  301.           </xsl:apply-templates>
  302.         </table>
  303.       </xsl:when>
  304.       <xsl:otherwise>
  305.         <table border="0" cellspacing="0" cellpadding="0" width="155">
  306.           <tr height="17">
  307.             <td width="24"><img src="img/dot.gif" height="1" width="20"/></td>
  308.             <td width="14" valign="top"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  309.             <xsl:choose>
  310.               <xsl:when test="@has_content = 'true'">
  311.                 <td width="103" valign="middle" class="copy">
  312.                   <a>
  313.                     <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  314.                     </xsl:attribute>
  315.                     <xsl:attribute name="class">copy</xsl:attribute>
  316.                     <xsl:if test="headtitle != 'null'">
  317.                       <xsl:apply-templates select="headtitle"/>
  318.                     </xsl:if>
  319.                   </a>
  320.                 </td>
  321.               </xsl:when>
  322.               <xsl:otherwise>
  323.                 <td width="103" valign="middle" class="copy">
  324.                   <xsl:attribute name="class">copy</xsl:attribute>
  325.                   <xsl:if test="headtitle != 'null'"><xsl:apply-templates select="headtitle"/></xsl:if>
  326.                 </td>
  327.               </xsl:otherwise>
  328.             </xsl:choose>
  329.             <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  330.           </tr>
  331.         </table>
  332.       </xsl:otherwise>
  333.     </xsl:choose>
  334.   </xsl:otherwise>
  335. </xsl:choose>
  336. </xsl:template>
  337.  
  338.   <xsl:template match="lv3">
  339.     <xsl:param name="parentTocId"/>
  340.     <xsl:choose>
  341.     <xsl:when test="$tocId = @tocid">
  342.     <script language="JavaScript">changeTocNode('toc<xsl:value-of select="$parentTocId"/>','img<xsl:value-of select="$parentTocId"/>');</script>
  343.       <tr>
  344.       <td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr>
  345.       <tr bgcolor="#FFFFFF" height="17">
  346.          <td width="30"><img src="img/arrow_red_r.gif" height="17" width="8"/></td>
  347.          <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  348.   <xsl:choose>
  349.     <xsl:when test="@has_content = 'true'">
  350.        <td width="97" valign="middle" class="copy">
  351.                 <a><xsl:attribute name="href">
  352.                 <xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  353.                 </xsl:attribute><xsl:attribute name="class">copy</xsl:attribute>    
  354.  
  355.   <xsl:if test="headtitle != 'null'">
  356.       <xsl:apply-templates select="headtitle"/>
  357.       </xsl:if></a></td>
  358.     </xsl:when>
  359.     <xsl:otherwise>
  360.       <td width="97" valign="middle" class="copy"><xsl:attribute name="class">copy</xsl:attribute> 
  361.        <xsl:if test="headtitle != 'null'">
  362.       <xsl:apply-templates select="headtitle"/>
  363.       </xsl:if></td>
  364.     </xsl:otherwise>
  365.   </xsl:choose>
  366.    <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  367.      </tr>
  368.       <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr> 
  369.     </xsl:when>
  370.     <xsl:otherwise>
  371.     <tr height="17"><td width="30"><img src="img/dot.gif" height="1" width="30"/></td>
  372.     <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  373.   <xsl:choose>
  374.     <xsl:when test="@has_content = 'true'">
  375.           <td width="97" valign="middle" class="copy">
  376.             <a>
  377.             <xsl:attribute name="href">
  378.             <xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  379.             </xsl:attribute>
  380.             <xsl:attribute name="class">copy</xsl:attribute>    
  381.  
  382.   <xsl:if test="headtitle != 'null'">
  383.       <xsl:apply-templates select="headtitle"/>
  384.       </xsl:if></a></td>
  385.     </xsl:when>
  386.     <xsl:otherwise>
  387.       <td width="97" valign="middle" class="copy">
  388.       <xsl:attribute name="class">copy</xsl:attribute>
  389.             <xsl:if test="headtitle !='null'">
  390.       <xsl:apply-templates select="headtitle"/>
  391.       </xsl:if></td>
  392.     </xsl:otherwise>
  393.   </xsl:choose>
  394.     <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  395.     </tr>
  396.     </xsl:otherwise>
  397.     </xsl:choose>
  398.     <xsl:apply-templates select="lv4">
  399.       <xsl:with-param name="parentTocId"><xsl:value-of select="$parentTocId"/></xsl:with-param>
  400.     </xsl:apply-templates>
  401.   </xsl:template>
  402.  
  403.   <xsl:template match="lv4">
  404.     <xsl:param name="parentTocId"/>
  405.     <xsl:choose>
  406.       <xsl:when test="$tocId = @tocid">
  407.           <script language="JavaScript">changeTocNode('toc<xsl:value-of select="$parentTocId"/>','img<xsl:value-of select="$parentTocId"/>');</script>
  408.     <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr> 
  409.     <tr height="17" bgcolor="#FFFFFF"><td width="40"><img src="/bcom/images/ebol04_arrow_red_r.gif" height="17" width="8"/></td>
  410.               <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  411.                 <xsl:choose>
  412.                   <xsl:when test="@has_content = 'true'">
  413.         <td width="87" valign="middle" class="copy">
  414.         <a><xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  415.         </xsl:attribute>
  416.         <xsl:attribute name="class">copy</xsl:attribute>
  417.           <xsl:if test="headtitle != 'null'">
  418.       <xsl:apply-templates select="headtitle"/>
  419.       </xsl:if></a></td>
  420.         </xsl:when>
  421.             <xsl:otherwise>
  422.         <td width="87" valign="middle" class="copy"><xsl:attribute name="class">copy</xsl:attribute>
  423.          <xsl:if test="headtitle != 'null'">
  424.       <xsl:apply-templates select="headtitle"/>
  425.       </xsl:if></td>
  426.             </xsl:otherwise>
  427.           </xsl:choose>
  428.         <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  429.       </tr>
  430.       <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr> 
  431.       </xsl:when>
  432.       <xsl:otherwise>
  433.     <tr height="17"><td width="40"><img src="img/dot.gif" height="1" width="40"/></td>
  434.     <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  435.   <xsl:choose>
  436.     <xsl:when test="@has_content = 'true'">
  437.       <td valign="middle" class="copy">
  438.       <a><xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  439. </xsl:attribute><xsl:attribute name="class">copy</xsl:attribute>    
  440.  
  441.   <xsl:if test="headtitle != 'null'">
  442.       <xsl:apply-templates select="headtitle"/>
  443.       </xsl:if></a></td>
  444.     </xsl:when>
  445.     <xsl:otherwise>
  446.       <td valign="middle" class="copy"><xsl:attribute name="class">copy</xsl:attribute>      <xsl:if test="headtitle != 
  447. 'null'">
  448.       <xsl:apply-templates select="headtitle"/>
  449.       </xsl:if></td>
  450.     </xsl:otherwise>
  451.   </xsl:choose>
  452.     <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  453.     </tr>
  454.     </xsl:otherwise>
  455.     </xsl:choose>
  456.     <xsl:apply-templates select="lv5">
  457.       <xsl:with-param name="parentTocId"><xsl:value-of select="$parentTocId"/></xsl:with-param>
  458.     </xsl:apply-templates>
  459.   </xsl:template>
  460.  
  461.   <xsl:template match="lv5">
  462.     <xsl:param name="parentTocId"/>
  463.      <xsl:choose>
  464.      <xsl:when test="$tocId = @tocid">
  465.           <script language="JavaScript">changeTocNode('toc<xsl:value-of select="$parentTocId"/>','img<xsl:value-of select="$parentTocId"/>');</script>
  466.       <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr> 
  467.       <tr height="17" bgcolor="#FFFFFF"><td width="50"><img src="/bcom/images/ebol04_arrow_red_r.gif" height="17" width="8"/></td>
  468.       <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  469.         <xsl:choose>
  470.           <xsl:when test="@has_content = 'true'">
  471.             <td width="77" valign="middle" class="copy"><a><xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  472. </xsl:attribute><xsl:attribute name="class">copy</xsl:attribute>    
  473.  
  474.   <xsl:if test="headtitle != 'null'">
  475.       <xsl:apply-templates select="headtitle"/>
  476.       </xsl:if></a></td>
  477.           </xsl:when>
  478.           <xsl:otherwise>
  479.             <td width="77" valign="middle" class="copy"><xsl:attribute name="class">copy</xsl:attribute>
  480.                   <xsl:if test="headtitle !='null'">
  481.       <xsl:apply-templates select="headtitle"/>
  482.       </xsl:if></td>
  483.           </xsl:otherwise>
  484.         </xsl:choose>
  485.       <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  486.       </tr>
  487.        <tr><td colspan="4" valign="top" height="1" background="img/tinydot.gif"><img src="img/dot.gif" height="1" width="151"/></td></tr>
  488.       </xsl:when>
  489.       <xsl:otherwise>
  490.        <tr height="17"><td width="50"><img src="img/dot.gif" height="1" width="50"/></td>
  491.            <td width="14" valign="top" class="copy"><img src="img/art_grey_bullet.gif" height="9" width="14" vspace="4"/></td>
  492.     <xsl:choose>
  493.       <xsl:when test="@has_content = 'true'">
  494.         <td valign="middle" class="copy"><a><xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$articleId"/>&library=<xsl:value-of select="$library"/><xsl:text>#</xsl:text><xsl:value-of select="@tocid"/>.toc
  495. </xsl:attribute><xsl:attribute name="class">copy</xsl:attribute>    
  496.  
  497.   <xsl:if test="headtitle != 'null'">
  498.       <xsl:apply-templates select="headtitle"/>
  499.       </xsl:if></a></td>
  500.       </xsl:when>
  501.       <xsl:otherwise>
  502.         <td valign="middle" class="copy"><xsl:attribute name="class">copy</xsl:attribute> 
  503.              <xsl:if test="headtitle !='null'">
  504.       <xsl:apply-templates select="headtitle"/>
  505.       </xsl:if></td>
  506.       </xsl:otherwise>
  507.           </xsl:choose>
  508.      <td width="10"><img src="img/dot.gif" height="1" width="10"/></td>
  509.        </tr>
  510.       </xsl:otherwise>
  511.       </xsl:choose>
  512.   </xsl:template>
  513.   
  514.   <xsl:template match = "headtitle">
  515.     <xsl:apply-templates mode="text_mode"/>
  516.   </xsl:template>
  517.   
  518.   
  519.   
  520.   <!-- undefined special characters are underlined -->
  521.     <xsl:template match="charundef" mode="text_mode">
  522.       <xsl:value-of select="@char"/>
  523.     </xsl:template>
  524.   
  525. </xsl:stylesheet>  
  526.