home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / oec2-lib.jar / xsl / cd / shared / baseArticle.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-25  |  33.3 KB  |  756 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.       xmlns:str="http://exslt.org/strings"
  7.       exclude-result-prefixes="html xhtml"
  8.       version="1.0">  
  9.       
  10.       <xsl:import href="basePage.xsl"/>
  11.       <xsl:import href="Variables.xsl"/>  
  12.       <xsl:import href="RefLinks.xsl"/>
  13.       <xsl:import href="ContentTags.xsl"/>
  14.       <xsl:import href="/xsl/shared/Section.xsl"/>
  15.       <!--   xsl:import href="ArticleRefLinks.xsl"/ -->
  16.       
  17.       <xsl:output method="html" omit-xml-declaration="yes" indent="no" encoding="UTF-8"/>
  18.       
  19.     <xsl:param name="tocId"/>    
  20.     <xsl:param name="articleId"/>
  21.     <xsl:param name="ct"/>
  22.     <xsl:param name="articleType"/>
  23.     <xsl:param name="relatedContentMenu"/>
  24.     <xsl:param name="hasToc">false</xsl:param>
  25.    
  26.     <!-- Locale-dependent strings -->
  27.     <xsl:param name="locale"/>
  28.     
  29.     <xsl:variable name="artId"><xsl:value-of select="$articleId"/></xsl:variable><!-- used in RefLinks.xsl -->
  30.      
  31.     <xsl:variable name="highlightQuery"><xsl:value-of select="/article/queryStr/text()"/></xsl:variable>
  32.     <xsl:variable name="mUrl"><xsl:value-of select="/article/mUrl/text()"/></xsl:variable>  
  33.     <xsl:variable name="prodName"><xsl:value-of select="/article/prodName/text()"/></xsl:variable>
  34.     
  35.     <xsl:variable name="sourceName">
  36.         <xsl:choose>
  37.             <xsl:when test="$ct = 'EBI'"><xsl:value-of select="$ebiLibraryText"/></xsl:when>
  38.             <xsl:when test="$ct = 'EBK'"><xsl:value-of select="$ebkLibraryText"/></xsl:when>
  39.             <xsl:when test="$ct = 'CONCISE'"><xsl:value-of select="$conciseLibraryText"/></xsl:when>
  40.             <xsl:otherwise><xsl:value-of select="$ebLibraryText" disable-output-escaping="yes"/></xsl:otherwise>
  41.         </xsl:choose>
  42.     </xsl:variable>
  43.     
  44.     <xsl:variable name="pageSubheading">
  45.         <xsl:choose>
  46.             <xsl:when test="$articleType = 'BBOY'"><xsl:value-of select="$bboyArticleText"/></xsl:when>
  47.             <xsl:when test="$ct = 'EBI'"><xsl:value-of select="$ebiArticleText"/></xsl:when>
  48.             <xsl:when test="$ct = 'EBK'"><xsl:value-of select="$ebkArticleText"/></xsl:when>
  49.             <xsl:when test="$ct = 'CONCISE'"><xsl:value-of select="$conciseArticleText"/></xsl:when>            
  50.             <xsl:otherwise><xsl:value-of select="$ebArticleText" disable-output-escaping="yes"/></xsl:otherwise>
  51.         </xsl:choose>
  52.     </xsl:variable>
  53.     <xsl:variable name="mmbintype">|7|8|9|13|20|25|</xsl:variable>
  54.  
  55.     <xsl:template match="/">
  56.         <xsl:call-template name="pageTemplate">
  57.             <xsl:with-param name="pageTitle"><xsl:call-template name="pageHeading"/></xsl:with-param>
  58.             <xsl:with-param name="pageHeading"><xsl:call-template name="pageHeading"/></xsl:with-param>
  59.             <xsl:with-param name="pageSubheading"><xsl:value-of select="$pageSubheading"/></xsl:with-param>
  60.             <xsl:with-param name="pageBody"><xsl:apply-templates select="article"/></xsl:with-param>
  61.             <xsl:with-param name="relatedContentMenu"><xsl:value-of select="$relatedContentMenu"/></xsl:with-param>
  62.             <xsl:with-param name="articleId"><xsl:value-of select="$articleId"/></xsl:with-param>
  63.         </xsl:call-template>
  64.     </xsl:template>
  65.  
  66.     <xsl:template match="article">
  67.         <xsl:apply-templates select="h0|h1|h2|h3|h4|h5"/>
  68.         <xsl:call-template name="backToTop"/>
  69.     <xsl:choose>
  70.         <xsl:when test="$ct = 'CONCISE'">
  71.             <br/>
  72.             <span class="upsell">
  73.                 <xsl:value-of select="$upsellText" disable-output-escaping="yes"/><xsl:text> </xsl:text>
  74.                 <a href="javascript:shopurl"><xsl:value-of select="$upsellLinkText" disable-output-escaping="yes"/></a>.
  75.             </span>
  76.     </xsl:when>
  77.     <xsl:otherwise></xsl:otherwise>
  78.     </xsl:choose>
  79.  
  80.         <xsl:call-template name="citation"/>    
  81.     </xsl:template>
  82.     
  83.     
  84.     <xsl:template name="pageHeading">
  85.         <xsl:choose>
  86.             <xsl:when test="//tabbrev">
  87.                 <xsl:apply-templates select="//title" mode="heading"/> (<xsl:apply-templates select="//tabbrev"/>)
  88.             </xsl:when>
  89.             <xsl:when test="//taxon[@ty='species']">
  90.                 <xsl:apply-templates select="//title" mode="heading"/> <i><xsl:apply-templates select="//taxon[@ty='species']"/></i>
  91.             </xsl:when>
  92.             <xsl:when test="//taxon[@ty='genus']">
  93.                 <xsl:apply-templates select="//title" mode="heading"/> <i><xsl:apply-templates select="//taxon[@ty='genus']"/></i>
  94.             </xsl:when>
  95.             <xsl:otherwise>
  96.                 <xsl:apply-templates select="//title" mode="heading"/>
  97.             </xsl:otherwise>
  98.         </xsl:choose>
  99.         <xsl:if test="//titlsub">
  100.             <xsl:apply-templates select="//titlsub"/>
  101.         </xsl:if>
  102.     </xsl:template>
  103.     
  104.     <xsl:template match="title"/>
  105.     
  106.     <xsl:template match="title" mode="heading">
  107.         <xsl:choose>
  108.             <xsl:when test="starts-with(../articleinfo/@contenttype, 'boy')">
  109.                 <div>Year in Review <xsl:value-of select="number(substring(../articleinfo/@contenttype, 4, 4)) - number(1)"/></div>  
  110.                 <xsl:text> </xsl:text>              
  111.                 <xsl:apply-templates/>
  112.             </xsl:when>          
  113.             <xsl:otherwise>
  114.                 <xsl:apply-templates select="titltxt"/>
  115.             </xsl:otherwise>
  116.         </xsl:choose>        
  117.     </xsl:template>  
  118.     
  119.     <xsl:template match="info">
  120.         <div class="info"><xsl:apply-templates/></div>
  121.     </xsl:template>
  122.     
  123.     <xsl:template match="datatype | datavalue">
  124.         <div class="data"><xsl:apply-templates/></div>
  125.     </xsl:template>
  126.     
  127.     <xsl:template match="sig">
  128.         <div class="sig"><xsl:apply-templates/></div>
  129.     </xsl:template>
  130.     
  131.     <xsl:template match="headingElements">
  132.         <xsl:if test="heading">
  133.             <div class="headingElements"><xsl:for-each select="heading">
  134.                 <xsl:sort select="level"/>
  135.                 <xsl:if test="position() > 1" > > </xsl:if>
  136.                 <xsl:apply-templates select="xmlTitle"/> 
  137.             </xsl:for-each></div>
  138.         </xsl:if>
  139.     </xsl:template>
  140.     
  141.     <xsl:template match="authorblurb">
  142.         <span class="authorblurb"><xsl:apply-templates/></span>
  143.     </xsl:template>
  144.     
  145.     <xsl:template match="charundef">
  146.         <xsl:value-of select="@char"/>
  147.     </xsl:template>
  148.  
  149.     
  150.     <xsl:template match="inline"> 
  151.         <xsl:choose>
  152.             <xsl:when test="@display = 'baseline'">
  153.                 <xsl:apply-templates select="asset" mode="baseline"/>
  154.             </xsl:when>
  155.             <xsl:when test="@display = 'centered'">
  156.                 <xsl:apply-templates select="asset" mode="centered"/>
  157.             </xsl:when>
  158.             <xsl:otherwise>
  159.                 <xsl:apply-templates select="asset" mode="below"/>
  160.             </xsl:otherwise>
  161.         </xsl:choose>        
  162.     </xsl:template>
  163.     
  164.     <xsl:template match="asset">
  165.         <a class="asset">
  166.              <xsl:attribute name="href"><xsl:value-of select="$assemblyURL"/>?assemblyId=<xsl:value-of select="@id"/>&type=I</xsl:attribute>
  167.              <xsl:apply-templates/>
  168.         </a>
  169.     </xsl:template>
  170.     
  171.       <xsl:template match="asset" mode="baseline">
  172.           <xsl:call-template name="regular_fullsize">
  173.               <xsl:with-param name="class" select="baseline"/>
  174.           </xsl:call-template> 
  175.       </xsl:template>
  176.       
  177.       <xsl:template match="asset" mode="centered">
  178.           <xsl:call-template name="regular_fullsize">
  179.               <xsl:with-param name="class" select="centered"/>
  180.           </xsl:call-template>  
  181.       </xsl:template>
  182.       
  183.       <xsl:template match="asset" mode="below">
  184.           <div class="centeredImg">
  185.           <xsl:call-template name="regular_fullsize"/> 
  186.           </div>
  187.       </xsl:template>
  188.     
  189.     <xsl:template name="regular_thumb">
  190.         <img class="thumb">
  191.             <xsl:attribute name="width"><xsl:value-of select="@thumbwdth"/></xsl:attribute>
  192.             <xsl:attribute name="height"><xsl:value-of select="@thumbhgt"/></xsl:attribute>
  193.             <xsl:attribute name="src"><xsl:value-of select="$thumbURL"/>?binaryId=<xsl:value-of select="@id"/></xsl:attribute>
  194.             <xsl:attribute name="alt"><xsl:value-of select="@mediatype"/><xsl:if test="../thumbcap">:<xsl:value-of select="../thumbcap"/></xsl:if></xsl:attribute>
  195.         </img>
  196.     </xsl:template>
  197.     
  198.     <xsl:template name="regular_fullsize">
  199.         <xsl:param name="alt"/>
  200.         <xsl:param name="class"/>
  201.             <img>
  202.                 <xsl:if test="$class != ''">
  203.                 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
  204.                 </xsl:if>
  205.                 <xsl:attribute name="width"><xsl:value-of select="@wdth"/></xsl:attribute>
  206.                 <xsl:attribute name="height"><xsl:value-of select="@hgt"/></xsl:attribute>
  207.                 <xsl:attribute name="alt"><xsl:choose><xsl:when test="$alt='flag'">flag</xsl:when><xsl:otherwise><xsl:value-of select="@mediatype"/><xsl:if test="../thumbcap">:<xsl:value-of select="../thumbcap"/></xsl:if></xsl:otherwise></xsl:choose></xsl:attribute>
  208.                 <xsl:attribute name="src"><xsl:value-of select="$inlineImageURL"/>?binaryId=<xsl:value-of select="@id"/></xsl:attribute>
  209.             </img>
  210.     </xsl:template> 
  211.     
  212.     <xsl:template match="gist/gistxt">
  213.         <p class="gist">
  214.             <xsl:apply-templates/>
  215.         </p>
  216.     </xsl:template> 
  217.     
  218.     <xsl:template match="formula">
  219.         <div class="formula"><xsl:apply-templates/></div>
  220.     </xsl:template>
  221.     
  222.     <xsl:template match="num">
  223.         <sup><xsl:apply-templates/></sup>
  224.     </xsl:template>
  225.     
  226.     <xsl:template match="den">
  227.         <sub><xsl:apply-templates/></sub>
  228.     </xsl:template>
  229.     
  230.     <xsl:template match="frac">
  231.         <span class="fraction"><sup><xsl:apply-templates select="num"/></sup>/<sub><xsl:apply-templates select="den"/></sub></span>
  232.     </xsl:template>
  233.     
  234.     <xsl:template match="sup|upper">
  235.        <xsl:variable name="mathLetter"><xsl:apply-templates/></xsl:variable>
  236.        <xsl:variable name="upperLetter"  select="translate($mathLetter,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>    
  237.         <xsl:variable name="vclass">
  238.           <xsl:choose>
  239.              <xsl:when test="number() = number()">numbersub</xsl:when>
  240.              <xsl:when test="$mathLetter = $upperLetter">numbersub</xsl:when>             
  241.              <xsl:otherwise>supandsub</xsl:otherwise>
  242.           </xsl:choose>
  243.         </xsl:variable>    
  244.         <span class="$vclass"><sup><xsl:apply-templates/></sup></span>
  245.     </xsl:template>
  246.     
  247.     <xsl:template match="sub|lower">
  248.        <xsl:variable name="mathLetter"><xsl:apply-templates/></xsl:variable>
  249.        <xsl:variable name="upperLetter"  select="translate($mathLetter,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  250.         <xsl:variable name="vclass">
  251.           <xsl:choose>
  252.              <xsl:when test="number() = number()">numbersub</xsl:when>
  253.              <xsl:when test="$mathLetter = $upperLetter">numbersub</xsl:when>
  254.              <xsl:otherwise>supandsub</xsl:otherwise>
  255.           </xsl:choose>
  256.         </xsl:variable>
  257.         <span class="{$vclass}"><sub><xsl:apply-templates/></sub></span>
  258.     </xsl:template>
  259.     
  260.     <xsl:template match="tbl" mode="thumb">
  261.         <xsl:apply-templates select="." mode="thumblink"/>    
  262.     </xsl:template>
  263.     
  264.     <xsl:template match="tbl" mode="thumblink">
  265.             <a class="thumbLink">
  266.                 <xsl:attribute name="href"><xsl:value-of select="$tableArticleURL"/>?tocId=<xsl:value-of select="@tocid"/></xsl:attribute>
  267.                 <xsl:for-each select=".">
  268.                     <xsl:if test="position() = 1">
  269.                         <xsl:call-template name="table_thumb"/>
  270.                     </xsl:if>
  271.                 </xsl:for-each>
  272.             </a>
  273.     </xsl:template>
  274.     
  275.     <xsl:template name="table_thumb">
  276.         <img class="tableThumb">
  277.             <xsl:attribute name="width"><xsl:value-of select="@thumbwdth"/></xsl:attribute>
  278.             <xsl:attribute name="height"><xsl:value-of select="@thumbhgt"/></xsl:attribute>
  279.             <xsl:attribute name="src">
  280.                 <xsl:value-of select="$thumbURL"/>?binaryId=<xsl:value-of select="@assetid"/>
  281.             </xsl:attribute>
  282.             <xsl:attribute name="alt"><xsl:value-of select="."/></xsl:attribute>
  283.         </img>
  284.     </xsl:template>
  285.     
  286.     <xsl:template match="tbl">
  287.         <a class="tableLink">
  288.             <xsl:choose>
  289.                 <xsl:otherwise>
  290.                     <xsl:attribute name="href"><xsl:value-of select="$tableArticleURL"/>?tocId=<xsl:value-of select="@tocid"/></xsl:attribute>
  291.                 </xsl:otherwise>
  292.             </xsl:choose>
  293.             <xsl:apply-templates/>
  294.         </a>
  295.     </xsl:template>
  296.     
  297.     <xsl:template match="byline">
  298.         <div class="byline">by <xsl:apply-templates/></div>
  299.     </xsl:template>
  300.     
  301.     <xsl:template match="prefnote">
  302.         <div class="prefnote"><xsl:apply-templates/></div>
  303.     </xsl:template>
  304.     
  305.     <xsl:template match="classicbody">
  306.         
  307.         <!-- it's important to implement the following tag exactly, as it will later be matched in a regular expression -->
  308.         <classic tocid="{@tocid}"></classic>
  309.     </xsl:template>
  310.     
  311.     <!-- needed to get the correct character from our new font -->
  312.     <xsl:template match="sqroot">
  313.         <xsl:variable name="multiterm">
  314.             <span class="formula"><xsl:apply-templates/></span>
  315.         </xsl:variable>
  316.         
  317.         <xsl:choose>
  318.             <xsl:when test="@radix=2 or not(@radix)"></xsl:when> 
  319.             <xsl:when test="@radix=n"><sup><i><xsl:value-of select="@radix"/></i></sup></xsl:when>
  320.             <xsl:otherwise><sup><xsl:value-of select="@radix"/></sup></xsl:otherwise>
  321.         </xsl:choose>
  322.         <xsl:choose>
  323.             <xsl:when test="contains($multiterm,'+') or contains($multiterm,'-') or contains($multiterm,'−')">
  324.                 √(<xsl:apply-templates/>)
  325.             </xsl:when>
  326.             <xsl:otherwise>√<xsl:apply-templates/></xsl:otherwise>
  327.         </xsl:choose>
  328.     </xsl:template>
  329.     
  330.     
  331.     <xsl:template match="p">        
  332.         <p>
  333.             <xsl:if test="descendant::asset[not(parent::inline) and @thumbwdth > 0]">
  334.                 <xsl:apply-templates select="descendant::assembly" mode="thumb"/>
  335.             </xsl:if>
  336.             <xsl:if test="descendant::tbl[@assetid]">
  337.                 <xsl:apply-templates select="descendant::tbl" mode="thumb"/>
  338.             </xsl:if>
  339.             
  340.             <xsl:apply-templates/>
  341.             <xsl:choose>
  342.                 <xsl:when test="not(following-sibling::p)"><div class="clear"> </div></xsl:when>
  343.                 <xsl:when test="following-sibling::p[position() = 1]/descendant::asset[not(parent::inline) and @thumbwdth > 0]"><div class="clear"> </div></xsl:when>
  344.             </xsl:choose>
  345.         </p>
  346.     </xsl:template>
  347.     
  348.     
  349.     <xsl:template match="fpartxt"> 
  350.     <div class="h1">       
  351.         <p>
  352.             <xsl:if test="..//asset[not(parent::inline) and @thumbwdth > 0]">
  353.                 <xsl:apply-templates select="..//assembly" mode="thumb"/>
  354.             </xsl:if>
  355.             <xsl:if test="descendant::tbl[@assetid]">
  356.                 <xsl:apply-templates select="descendant::tbl" mode="thumb"/>
  357.             </xsl:if>
  358.             
  359.             <xsl:if test="//tvtype | //tvarint | //tvcnjtive">
  360.                 <i><xsl:apply-templates select="//tvtype | //tvarint | //tvcnjtive" mode="tvar"/></i>
  361.             </xsl:if>    
  362.             
  363.                 <xsl:apply-templates/>
  364.                 
  365.                 <xsl:choose>
  366.                     <xsl:when test="not(parent::node()/following-sibling::p)"><div class="clear"> </div></xsl:when>
  367.                     <xsl:when test="parent::node()/following-sibling::p[position() = 1]/descendant::asset[not(parent::inline) and @thumbwdth > 0]"><div class="clear"> </div></xsl:when>
  368.                 </xsl:choose>
  369.        </p>        
  370.        </div>
  371.     </xsl:template>
  372.     
  373.     
  374.     <xsl:template match="chronology">
  375.         <xsl:variable name="formated">
  376.             <xsl:value-of select="concat(translate(substring(@month,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),substring(@month,2))"/>
  377.         </xsl:variable>
  378.         
  379.         <div class="h1">
  380.             <h2><xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute><xsl:value-of select="$formated"/></h2>        
  381.         <xsl:apply-templates/>
  382.         </div>
  383.     </xsl:template>   
  384.     
  385.       <xsl:template match="chronquote">
  386.           <blockquote class="chronquote">
  387.               "<xsl:apply-templates select="initquote"/>"
  388.               <div class="quotesource">— <xsl:apply-templates select="quotesource"/></div>
  389.           </blockquote>
  390.       </xsl:template>
  391.       
  392.       <xsl:template match="cdate">
  393.           <xsl:variable name="month">
  394.               <xsl:value-of select="parent::chronology/@month"/>
  395.           </xsl:variable>
  396.           
  397.           <xsl:variable name="formated">
  398.               <xsl:value-of select="concat(translate(substring($month,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),substring($month,2))"/>
  399.           </xsl:variable>
  400.           
  401.           <div class="h2">
  402.               <h3><xsl:value-of select="$formated"/><xsl:text> </xsl:text><xsl:value-of select="@value"/></h3>
  403.               <p><xsl:apply-templates/></p>
  404.           </div>
  405.       </xsl:template>
  406.     
  407.     
  408.     <xsl:template match="assembly">
  409.         <xsl:if test="arttext">
  410.         <a class="artText">
  411.         <xsl:choose>
  412.             <xsl:when test="contains($mmbintype, concat('|',asset/@bintype,'|'))">
  413.                 <xsl:attribute name="href"><xsl:value-of select="$assemblyMultimediaURL"/>?assemblyId=<xsl:value-of select="@id"/>&type=M</xsl:attribute>
  414.             </xsl:when>
  415.             <xsl:otherwise>
  416.                 <xsl:attribute name="href"><xsl:value-of select="$assemblyURL"/>?assemblyId=<xsl:value-of select="@id"/>&type=A</xsl:attribute>
  417.             </xsl:otherwise>
  418.             
  419.         </xsl:choose>
  420.             <xsl:apply-templates select="arttext"/>
  421.         </a>
  422.         </xsl:if>
  423.     </xsl:template>    
  424.     
  425.     <xsl:template match="assembly" mode="thumb">
  426.         
  427.         <xsl:variable name="url">
  428.             <xsl:choose>
  429.                 <xsl:when test="asset/@flaghisttocid > '0'"><xsl:value-of select="$articleURL"/></xsl:when>
  430.                 <xsl:when test="asset/@mediatype='Map/Still'"><xsl:value-of select="$assemblyAtlasURL"/></xsl:when>
  431.                 <xsl:when test="asset/@bintype > 2"><xsl:value-of select="$assemblyMultimediaURL"/></xsl:when>
  432.                 <xsl:otherwise>
  433.                     <xsl:value-of select="$assemblyURL"/></xsl:otherwise>
  434.             </xsl:choose>
  435.         </xsl:variable>
  436.         
  437.         <xsl:variable name="flagTOC">
  438.             <xsl:value-of select="asset/@flaghisttocid"/>
  439.         </xsl:variable>
  440.         
  441.         
  442.         <div class="assembly">
  443.             <a class="asset">
  444.                 <xsl:choose>
  445.                     <xsl:when test="asset[@flaghisttocid != '']">
  446.                         <xsl:attribute name="href"><xsl:value-of select="$url"/>?articleId=<xsl:value-of select="$flagTOC - 9000000"/>&library=<xsl:value-of select="$ct"/>&query=<xsl:value-of select="$highlightQuery"/>#<xsl:value-of select="asset/@flaghisttocid"/>.toc</xsl:attribute>
  447.                     </xsl:when>
  448.                     <xsl:otherwise><xsl:attribute name="href"><xsl:value-of select="$url"/>?assemblyId=<xsl:value-of select="@id"/>&type=A</xsl:attribute>
  449.                     </xsl:otherwise>
  450.                 </xsl:choose>
  451.                 <xsl:for-each select="asset">
  452.                     <xsl:if test="position() = 1">
  453.                         <xsl:choose>
  454.                             <xsl:when test="@thumbwdth > 0">
  455.                                 <xsl:call-template name="regular_thumb"/>
  456.                             </xsl:when>
  457.                             <xsl:otherwise>
  458.                                 <xsl:value-of select="@mediatype"/>
  459.                             </xsl:otherwise>
  460.                         </xsl:choose>
  461.                         <div class="clear"> </div>
  462.                     </xsl:if>
  463.                 </xsl:for-each>
  464.             </a>
  465.             <ul class="captions">
  466.             <xsl:apply-templates select="thumbcap">
  467.                 <xsl:with-param name="parsed">true</xsl:with-param>
  468.             </xsl:apply-templates>
  469.             <xsl:apply-templates select="thumbcred">
  470.                 <xsl:with-param name="parsed">true</xsl:with-param>
  471.             </xsl:apply-templates>
  472.             </ul>
  473.         </div>
  474.     </xsl:template>
  475.     
  476.     
  477.     <xsl:template match="thumbcap">
  478.         <xsl:param name="parsed"></xsl:param>
  479.         <xsl:if test="$parsed != ''">
  480.             <li class="thumbcap"><xsl:apply-templates/></li>
  481.         </xsl:if>        
  482.     </xsl:template>
  483.     
  484.    <xsl:template match="thumbcred">
  485.         <xsl:param name="parsed"></xsl:param>
  486.         <xsl:if test="$parsed != ''">
  487.            <xsl:variable name="credtext" select="."/>
  488.            <xsl:variable name="tokenizedtext" select="str:tokenize($credtext,' ')"/>
  489.            <xsl:variable name="displaytext"> 
  490.                 <xsl:for-each select="$tokenizedtext">
  491.                     <xsl:variable name="token" select="."/>
  492.                     <xsl:if test="string-length($token) > 18">
  493.                         false
  494.                     </xsl:if>    
  495.                 </xsl:for-each>  
  496.            </xsl:variable>    
  497.            <xsl:if test="not($displaytext)"><!--  Suppress display of thumbcred with long words -->
  498.                <li class="thumbcred"><xsl:apply-templates/></li>
  499.            </xsl:if>
  500.         </xsl:if>
  501.     </xsl:template>    
  502.     
  503.     <xsl:template match="authcr">
  504.         <!-- surpress the author link if it's editor of EB -->
  505.         <xsl:if test="not(@persid='4419') and @persid != ''">            
  506.             <a class="authcr">
  507.                 <xsl:attribute name="href"><xsl:value-of select="$authorURL"/>?authorId=<xsl:value-of select="@persid"/></xsl:attribute>
  508.                 <xsl:apply-templates/>
  509.             </a>            
  510.         </xsl:if>
  511.     </xsl:template>
  512.     
  513.     <xsl:template match="signature">
  514.         <a class="signature">
  515.             <xsl:attribute name="href"><xsl:value-of select="$authorURL"/>?authorId=<xsl:value-of select="@persid"/></xsl:attribute>
  516.             <xsl:apply-templates/>
  517.         </a>        
  518.     </xsl:template>
  519.     
  520.     <xsl:template match="bdate">
  521.         <div class="bdate">
  522.             <xsl:if test="//firstpar/pairbio and position() = 1">
  523.                 Respectively, <div class="clear"> </div>
  524.             </xsl:if>
  525.             <xsl:choose>
  526.                 <xsl:when test="@ty='fl'"> flourished </xsl:when>
  527.                 <xsl:when test="@ty='bap'"> baptized </xsl:when>
  528.                 <xsl:otherwise> born </xsl:otherwise>
  529.             </xsl:choose>
  530.             <xsl:apply-templates/>
  531.             <div class="clear"> </div>
  532.         </div>
  533.     </xsl:template>
  534.     
  535.     
  536.     <xsl:template match="ddate">
  537.         <div class="ddate">
  538.             <xsl:choose>
  539.                 <xsl:when test="@ty='kill'"> killed in action </xsl:when>
  540.                 <xsl:when test="@ty='bur'"> buried </xsl:when>
  541.                 <xsl:when test="@ty='found'"> found dead </xsl:when>
  542.                 <xsl:otherwise> died </xsl:otherwise>
  543.             </xsl:choose>
  544.             <xsl:apply-templates/>
  545.         </div>
  546.     </xsl:template>
  547.     
  548.     <xsl:template match="headtitle">
  549.         <xsl:apply-templates/>
  550.     </xsl:template>    
  551.     
  552.       <xsl:template match="h0">
  553.          <a><xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute></a>
  554.           <xsl:if test="count(//headtitle) > 1">
  555.               <h2>Introduction</h2>
  556.           </xsl:if>
  557.          <xsl:apply-templates select="*[name() != 'headtitle']"/>     
  558.       </xsl:template>
  559.     
  560.     <xsl:template match="h1">        
  561.         <div class="h1"> 
  562.             <xsl:if test="headtitle">               
  563.                 <h2>
  564.                     <xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  565.                     <xsl:apply-templates select="headtitle"/>
  566.                 </h2>
  567.             </xsl:if> 
  568.             <xsl:apply-templates select="*[name() != 'headtitle']"/>
  569.         </div>
  570.     </xsl:template>
  571.     
  572.     <xsl:template match="h2">
  573.         <div class="h2">                
  574.                 <h3>
  575.                     <xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  576.                     <xsl:apply-templates select="headtitle"/>
  577.                 </h3>
  578.             <xsl:apply-templates select="*[name() != 'headtitle']"/>
  579.         </div>        
  580.     </xsl:template>
  581.     
  582.     <xsl:template match="h3">
  583.         <div class="h3">
  584.             <h4>
  585.                 <xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  586.                 <xsl:apply-templates select="headtitle"/>
  587.             </h4>
  588.             <xsl:apply-templates select="*[name() != 'headtitle']"/>
  589.         </div>       
  590.     </xsl:template>
  591.     
  592.     <xsl:template match="h4">
  593.         <div class="h3">
  594.             <h5>
  595.                 <xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  596.                 <xsl:apply-templates select="headtitle"/>
  597.             </h5>
  598.             <xsl:apply-templates select="*[name() != 'headtitle']"/>
  599.         </div>        
  600.     </xsl:template>
  601.     
  602.     <xsl:template match="h5">
  603.         <div class="h5">
  604.             <h6>
  605.                 <xsl:attribute name="id"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  606.                 <xsl:apply-templates select="headtitle"/>
  607.             </h6>
  608.             <xsl:apply-templates select="*[name() != 'headtitle']"/>
  609.         </div>        
  610.     </xsl:template>
  611.     
  612.     <xsl:template match="uninvrtitl">
  613.         <span class="uninvrtitl"><xsl:apply-templates/></span>
  614.     </xsl:template>
  615.     
  616.       <xsl:template match="list">
  617.           <div class="list">
  618.               <xsl:choose>
  619.                   <!-- formatting provided in content -->
  620.                   <xsl:when test="@numsty='e'">
  621.                       <ul style="list-item-type: none;"><xsl:apply-templates/></ul>
  622.                   </xsl:when>
  623.                   <!-- bullets -->
  624.                   <xsl:when test="@numsty='u'">
  625.                       <ul><xsl:apply-templates/></ul>
  626.                   </xsl:when>
  627.                   <!-- uppercase letters -->                  
  628.                   <xsl:when test="@numsty='a'">
  629.                           <ol type="A"><xsl:apply-templates/></ol>
  630.                   </xsl:when>
  631.                   <!-- numbered -->
  632.                   <xsl:otherwise>
  633.                           <ol type="1"><xsl:apply-templates/></ol>
  634.                   </xsl:otherwise>
  635.               </xsl:choose>
  636.          </div>
  637.       </xsl:template>
  638.     
  639.     
  640.     <xsl:template name="citation">
  641.  
  642.         <div id="cite">
  643.             
  644.             <h2 class="citationHead">
  645.                 <span class="text"><xsl:value-of select="$citeText" /></span>
  646.             </h2>
  647.             <ul class="citations">
  648.                         <li>
  649.                             <i><xsl:value-of select="$mlaStyleText" />:</i>
  650.                             <div class="clear"> </div>
  651.                             <b>"<xsl:call-template name="pageHeading"/>." </b>
  652.                             <xsl:value-of select="$sourceName" disable-output-escaping="yes"/>. 
  653.                             <u><xsl:value-of select="$prodName"/></u>. 
  654.                             <xsl:value-of select="$chicagoText" /> <xsl:value-of select="$britannicaText" disable-output-escaping="yes"/>, <script>document.write(new Date().getFullYear());</script>.
  655.                        </li>
  656.                        <li>
  657.                             <i><xsl:value-of select="$apaStyleText" />:</i>
  658.                             <div class="clear"> </div>
  659.                             <b><xsl:call-template name="pageHeading"/>. </b>
  660.                             (<script>document.write(new Date().getFullYear());</script>).
  661.                             <xsl:value-of select="$sourceName" disable-output-escaping="yes"/>.
  662.                             <i><xsl:value-of select="$prodName"/>.</i> 
  663.                             <xsl:value-of select="$chicagoText" /> <xsl:value-of select="$britannicaText" disable-output-escaping="yes" />.
  664.                        </li>
  665.                        <li>
  666.                             <i><xsl:value-of select="$britannicaStyleText" /></i>
  667.                             <div class="clear"> </div>
  668.                             <b>"<xsl:call-template name="pageHeading"/>." </b>
  669.                             <xsl:value-of select="$sourceName" disable-output-escaping="yes"/> <xsl:value-of select="$fromText"/> <i><xsl:value-of select="$prodName"/>.</i>
  670.                             (<script>document.write(new Date().getFullYear());</script>).
  671.                        </li>
  672.             </ul>
  673.         </div>
  674.         <div class="clear"> </div>
  675.     </xsl:template>    
  676.     
  677.     <xsl:template name="sidebar">
  678.         <div id="sidebarTitleBar">
  679.             <span id="sideBarTitleTOC"><xsl:value-of select="$tableOfContentsText"/></span>
  680.             <span id="sideBarTitleNotes"><xsl:value-of select="$notesViewerText"/></span>
  681.             <span id="sideBarTitleLoading"><xsl:value-of select="$loadingText" /></span>
  682.             <a id="closeSidebarButton" onclick="hideSideBar();"><span class="linkLabel">Close</span></a>
  683.         </div>
  684.         
  685.         <div id="sidebarContent" class="content">
  686.             <div id="articleToc">
  687.             </div>                
  688.             <div id="articleNotes">
  689.                 <ul id="notesViewerList">
  690.                 </ul>
  691.                 <input type="hidden" id="notesToDelete" value=""/>
  692.                 <a id="notesViewerDeleteButton" style="display: none;" onclick="deleteNotes();"><xsl:attribute name="href">annotate:deleteNotes?articleId=<xsl:value-of select="$articleId"/></xsl:attribute><span class="buttonLabel">Delete Selected Notes</span></a>
  693.             </div>
  694.         </div>
  695.     </xsl:template>
  696.     
  697.     <xsl:template name="notesButton">
  698.         <li id="notesButton" class="menuContainer">                            
  699.             <a class="menuButton toolbarButton" onmouseout="hideTip();">
  700.                 <xsl:attribute name="onmouseover">showTip('<xsl:value-of select="$notesTooltip"/>', 150, event);</xsl:attribute>
  701.                 <span class="linkLabel">Notes</span></a>                          
  702.         </li>
  703.     </xsl:template>
  704.     
  705.     <xsl:template name="notesMenu">        
  706.         <ul id="notesMenu" class="popUpMenu">
  707.             <li><a><xsl:attribute name="href">annotate:takeNote?articleId=<xsl:value-of select="$articleId"/></xsl:attribute><span class="menuItemText">Take a Note</span></a></li>
  708.             <li id="showNotesItem" class="enabledMenuItem"><a onclick="swapMenuItem('showNotesItem', 'hideNotesItem');"><xsl:attribute name="href">annotate:showNotes?articleId=<xsl:value-of select="$articleId"/></xsl:attribute><span class="menuItemText">Show Notes</span></a></li>
  709.             <li id="hideNotesItem" class="disabledMenuItem"><a onclick="swapMenuItem('hideNotesItem', 'showNotesItem');"><xsl:attribute name="href">annotate:hideNotes?articleId=<xsl:value-of select="$articleId"/></xsl:attribute><span class="menuItemText">Hide Notes</span></a></li>
  710.         </ul> 
  711.     </xsl:template>
  712.     
  713.     <xsl:template name="sideBarControls">
  714.         <div id="sideBarControlsContainer">
  715.         <ul>
  716.             <xsl:if test="$hasToc = 'true'">
  717.                 <li id="articleTocButton"><a onmouseout="hideTip();">
  718.                                               <xsl:attribute name="href">javascript:loadToc('<xsl:value-of select="$articleTocURL"/>?articleId=<xsl:value-of select="$articleId"/>');</xsl:attribute>
  719.                                               <xsl:attribute name="onmouseover">showTip('<xsl:value-of select="$TOCTooltip" />', 150, event);</xsl:attribute>
  720.                                               <img src="img/bcd07_all_art_toc_icon.png" width="15" height="17"/><span class="linkLabel">View Table of Contents</span></a></li>
  721.             </xsl:if>
  722.             <li id="articleNotesButton"><a onmouseout="hideTip();">
  723.                                             <xsl:attribute name="href">annotate:viewNotes?articleId=<xsl:value-of select="$articleId"/></xsl:attribute>
  724.                                              <xsl:attribute name="onmouseover">showTip('<xsl:value-of select="$notesViewerTooltip" />', 150, event);</xsl:attribute>
  725.                                             <xsl:attribute name="onclick">showNotes();</xsl:attribute><img src="img/bcd07_all_art_nv_icon.png" width="15" height="17"/><span class="linkLabel">Notes Viewer</span></a></li>
  726.         </ul>
  727.         </div>
  728.     </xsl:template> 
  729.     
  730.     <xsl:template name="contentUpdate">
  731.         <xsl:param name="articleId"/>
  732.         <div id="contentUpdate">
  733.         <a href="articleupdate://?articleId={$articleId}"></a>
  734.         </div>
  735.     </xsl:template> 
  736.  
  737.     <!-- the version of this template that would otherwise be inherited from shared/Variables.xsl
  738.          refers to an absolute path (/bcom/gifs); we need a relative path for webrenderer -->
  739.     <xsl:template match="charimg">
  740.         <xsl:variable name="gif">
  741.             <xsl:value-of select="@src"/>
  742.         </xsl:variable>
  743.  
  744.         <xsl:variable name="fn">
  745.             <xsl:value-of select="concat('./bcom/gifs/',$gif)"/>
  746.         </xsl:variable>
  747.  
  748.         <img>
  749.             <xsl:attribute name="src">
  750.                 <xsl:value-of select="$fn"/>
  751.             </xsl:attribute>
  752.         </img>
  753.     </xsl:template>
  754.      
  755. </xsl:stylesheet>
  756.