home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / oec2-lib.jar / xsl / shared / Section.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-25  |  23.8 KB  |  853 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:import href="Variables.xsl"/>
  10.  
  11.   <xsl:output method="html" encoding="UTF-8"/>
  12.   
  13.   <!-- this xsl defines processing instructions for elements that are defined in ENTITY incl -->
  14.   <!-- So far that %incl serves both bup_xml.dtd and classic_xml.dtd -->
  15.     
  16.  
  17.   <xsl:template match="sidebar">
  18.     <xsl:apply-templates/>
  19.   </xsl:template>
  20.  
  21.   <xsl:template match="btw">
  22.     <xsl:apply-templates/>
  23.   </xsl:template>
  24.  
  25.   <xsl:template match="bup">
  26.     <xsl:apply-templates/>
  27.   </xsl:template>
  28.  
  29.   <xsl:template match="title">
  30.     <xsl:choose>
  31.     <xsl:when test="starts-with(../articleinfo/@contenttype, 'boy')">
  32.       <h1>
  33.         Year in Review 
  34.         <xsl:value-of select="substring(../articleinfo/@contenttype, 4, 4)"/>: 
  35.         <xsl:value-of select="../articleinfo/@contentsubtype"/>
  36.       </h1>
  37.       <h2><xsl:apply-templates/></h2>
  38.     </xsl:when>
  39.     <xsl:when test="parent::sidebar">
  40.       <title>Sidebar:<xsl:value-of select="titltxt/text()"/></title>
  41.       <xsl:apply-templates select="titltxt" mode="sidebar"/>
  42.     </xsl:when>
  43.     <xsl:otherwise>
  44.       <h1><xsl:apply-templates/></h1>
  45.     </xsl:otherwise>
  46.     </xsl:choose>
  47.   </xsl:template>
  48.  
  49.   <xsl:template match="uninvrtitl">
  50.     <xsl:apply-templates/>
  51.   </xsl:template>
  52.  
  53.   <xsl:template match="titltxt" mode="sidebar">
  54.     <h1>Sidebar - <xsl:apply-templates/></h1>
  55.   </xsl:template>
  56.  
  57.   <xsl:template match="titlexp">
  58.     <p><small><xsl:apply-templates/></small></p>
  59.   </xsl:template>
  60.  
  61.   <xsl:template match="ttrans">
  62.     <br>(<xsl:apply-templates/>)</br>
  63.   </xsl:template>
  64.  
  65.   <xsl:template match="taxon">
  66.   (<xsl:if test="@ty !='species'"><xsl:value-of select="@ty"/> </xsl:if>
  67.   <xsl:choose>
  68.     <xsl:when test="@ty='genus'"><i><xsl:apply-templates/></i></xsl:when>
  69.     <xsl:when test="@ty='subgenus'"><i><xsl:apply-templates/></i></xsl:when>
  70.     <xsl:when test="@ty='species'"><i><xsl:apply-templates/></i></xsl:when>
  71.     <xsl:when test="@ty='subspecies'"><i><xsl:apply-templates/></i></xsl:when>
  72.     <xsl:otherwise><font face="Roman"><xsl:apply-templates/></font></xsl:otherwise>
  73.   </xsl:choose>)
  74.   </xsl:template>
  75.  
  76.   <xsl:template match="titlsub">
  77.     <font size="5"><xsl:apply-templates/></font>
  78.   </xsl:template>
  79.  
  80.   <xsl:template match="tabbrev|chemsym">
  81.     (<xsl:apply-templates/>)
  82.   </xsl:template>
  83.  
  84. <!-- these templates should not be processed at their location in the text, only
  85.      when called through the 'tvar' mode -->
  86.   <xsl:template match="tvtype"/>
  87.  
  88.   <xsl:template match="tvarint"/>
  89.  
  90.   <xsl:template match="tvcnjtive"/>
  91.  
  92.   <xsl:template match="tvcnjtion"/>
  93.  
  94.   <xsl:template match="tvtype" mode="tvar">
  95.     <xsl:apply-templates/><xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text>
  96.   </xsl:template>
  97.  
  98.   <xsl:template match="tvarint" mode="tvar">
  99.     <b><xsl:apply-templates/></b><xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text>
  100.   </xsl:template>
  101.  
  102.   <xsl:template match="tvcnjtive" mode="tvar">
  103.     <xsl:apply-templates/><xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text>
  104.   </xsl:template>
  105.  
  106.   <xsl:template match="tvcnjtion" mode="tvar">
  107.     <xsl:apply-templates/><xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text>
  108.   </xsl:template>
  109.  
  110.   <!-- ref points -->
  111.   <xsl:template match="refpt">
  112.     <a>
  113.       <xsl:attribute name="name"><xsl:value-of select="@ref"/>.ref</xsl:attribute>
  114.     </a>
  115.   </xsl:template>
  116.  
  117.   <xsl:template match="inline">
  118.         <xsl:apply-templates select="asset"/>
  119.         <xsl:if test="count(../inline) = 1"><br/></xsl:if>
  120.   </xsl:template>
  121.  
  122.   <xsl:template match="asset">
  123.     <xsl:choose>
  124.     <xsl:when test="parent::inline">
  125.       <center>
  126.         <xsl:call-template name="regular_fullsize"/>
  127.       </center>
  128.       
  129.     </xsl:when>
  130.     <xsl:otherwise>
  131.       <a>
  132.         <xsl:attribute name="href"><xsl:value-of select="$assemblyURL"/>?assemblyId=<xsl:value-of select="@id"/>&type=I</xsl:attribute>
  133.         <xsl:apply-templates/>
  134.       </a>
  135.     </xsl:otherwise>
  136.     </xsl:choose>
  137.   </xsl:template>
  138.  
  139.   <xsl:template name="regular_thumb">
  140.     <img>
  141.       <xsl:attribute name="width"><xsl:value-of select="@thumbwdth"/></xsl:attribute>
  142.       <xsl:attribute name="height"><xsl:value-of select="@thumbhgt"/></xsl:attribute>
  143.       <xsl:attribute name="src"><xsl:value-of select="$thumbURL"/>?binaryId=<xsl:value-of select="@id"/></xsl:attribute>
  144.       <xsl:attribute name="alt"><xsl:value-of select="../thumbcap"/></xsl:attribute>
  145.     </img>
  146.   </xsl:template>
  147.  
  148.   <xsl:template name="regular_fullsize">
  149.     
  150.     <img>
  151.       <xsl:attribute name="width"><xsl:value-of select="@wdth"/></xsl:attribute>
  152.       <xsl:attribute name="height"><xsl:value-of select="@hgt"/></xsl:attribute>
  153.       <xsl:attribute name="src"><xsl:value-of select="$imageURL"/>?binaryId=<xsl:value-of select="@id"/></xsl:attribute>
  154.     </img>
  155.     
  156.   </xsl:template>
  157.  
  158.  
  159.   <xsl:template match="thumbcred">
  160.       <i><xsl:apply-templates/></i>
  161.   </xsl:template>
  162.  
  163. <!-- END ART AND IMG -->
  164.  
  165. <!-- START MATH -->
  166. <xsl:template match="formula">
  167.   <br/><br/><xsl:apply-templates/><br/><br/>
  168. </xsl:template>
  169.  
  170. <xsl:template match="num">
  171.     <!-- cd browse can't support embedded sup and sub, so we change it to the following.
  172.                 example is analysis article , look at Formal definition of the derivative, text of average 
  173.                 speed of time interval-->
  174.     <xsl:variable name="numerator">
  175.         <xsl:apply-templates/>
  176.     </xsl:variable>
  177.     <xsl:choose>
  178.         <xsl:when test="contains($numerator,'+') or contains($numerator,'-') or contains($numerator,'−')">(<xsl:apply-templates/>)</xsl:when>
  179.       <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
  180.     </xsl:choose>
  181. </xsl:template>
  182.  
  183. <xsl:template match="den">
  184.     <xsl:variable name="denominator">
  185.         <xsl:apply-templates/>
  186.     </xsl:variable>
  187.     <xsl:choose>
  188.         <xsl:when test="contains($denominator,'+') or contains($denominator,'-') or contains($denominator,'−')">(<xsl:apply-templates/>)</xsl:when>
  189.       <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
  190.     </xsl:choose>
  191. </xsl:template>
  192.  
  193. <xsl:template match="upper">
  194.     <sup><xsl:apply-templates/></sup>
  195. </xsl:template>
  196.  
  197. <xsl:template match="lower">
  198.     <sub><xsl:apply-templates/></sub>
  199. </xsl:template>
  200.  
  201. <!-- integrals -->
  202. <xsl:template match="int">
  203.   ∫<xsl:apply-templates select="lower"/><xsl:apply-templates select="upper"/>
  204. </xsl:template>
  205.  
  206.   <!-- good example to test against /oec/shared/component/Section.jsp?eu=570902 -->
  207.   <xsl:template match="sqroot">
  208.     <xsl:choose>
  209.       <xsl:when test="@radix=2 or not(@radix)"></xsl:when> 
  210.       <xsl:when test="@radix=n"><sup><i><xsl:value-of select="@radix"/></i></sup></xsl:when>
  211.       <xsl:otherwise><sup><xsl:value-of select="@radix"/></sup></xsl:otherwise>
  212.     </xsl:choose>
  213.     <xsl:call-template name="charfont">
  214.       <xsl:with-param name="font">symbol</xsl:with-param>
  215.       <xsl:with-param name="char">&#214;</xsl:with-param>
  216.     </xsl:call-template>
  217.     <xsl:apply-templates/>
  218.   </xsl:template>
  219. <!-- END MATH -->
  220.  
  221. <!-- start xrefs -->
  222.  
  223.   <xsl:template match="tbl">
  224.     <a>
  225. <xsl:choose>
  226. <xsl:when test="$printableArticleURL != ''">
  227.       <xsl:attribute name="href"><xsl:value-of select="$printableArticleURL"/>?eu=<xsl:value-of select="@euid"/></xsl:attribute>
  228. </xsl:when>
  229. <xsl:otherwise>
  230.       <xsl:variable name="tocid">
  231.         <xsl:value-of select="number(@artclid)+number(9000000)"/>
  232.       </xsl:variable>    
  233.       <xsl:attribute name="href"><xsl:value-of select="$tableArticleURL"/>?tocId=<xsl:value-of select="$tocid"/></xsl:attribute>
  234. </xsl:otherwise>
  235. </xsl:choose>
  236.       <xsl:apply-templates/>
  237.     </a>
  238.   </xsl:template>
  239.  
  240. <!-- elements from % text -->
  241.  
  242. <xsl:template match="list">
  243.     <p>
  244.     <xsl:choose>
  245.     <!-- formatting provided in content -->
  246.     <xsl:when test="@numsty='e'">
  247.       <blockquote><xsl:apply-templates/></blockquote>
  248.     </xsl:when>
  249. <!-- bullets -->
  250.     <xsl:when test="@numsty='u'">
  251.       <ul><xsl:apply-templates/></ul>
  252.     </xsl:when>
  253. <!-- uppercase letters -->
  254.  
  255.    <!-- if there is a thumbnail before the <ol> then some list numbers are not
  256.         able to display from IE browser. A <table> tag is added to resolving
  257.         this issue. bug# 726 -->
  258.     <xsl:when test="@numsty='a'">
  259.      <table><tr><td>
  260.       <ol type="A"><xsl:apply-templates/></ol>
  261.      </td></tr></table>
  262.     </xsl:when>
  263. <!-- numbered -->
  264.     <xsl:otherwise>
  265.      <table><tr><td>
  266.       <ol type="1"><xsl:apply-templates/></ol>
  267.      </td></tr></table>
  268.     </xsl:otherwise>
  269.   </xsl:choose>
  270.   </p>
  271. </xsl:template>
  272.  
  273. <xsl:template match="item">
  274.   <li><xsl:apply-templates/></li>
  275. </xsl:template>
  276.  
  277. <xsl:template match="item[@numsty='e']">
  278.   <xsl:apply-templates/><br/>
  279. </xsl:template>
  280.  
  281. <xsl:template match="qt">
  282.   <blockquote><xsl:apply-templates/></blockquote>
  283. </xsl:template>
  284.  
  285. <xsl:template match="qtpara">
  286.     <xsl:apply-templates/><br/>
  287. </xsl:template>
  288.  
  289. <xsl:template match="poetry">
  290.   <xsl:choose>
  291.     <xsl:when test="@display='center'">
  292.       <center>
  293.         <xsl:apply-templates/>
  294.       </center>
  295.     </xsl:when>
  296.     <xsl:otherwise>
  297.       <blockquote>
  298.         <xsl:apply-templates/>
  299.       </blockquote>
  300.     </xsl:otherwise>
  301.   </xsl:choose>
  302. </xsl:template>
  303.  
  304. <xsl:template match="line">
  305.   <xsl:apply-templates/><br/>
  306. </xsl:template>
  307.  
  308. <xsl:template match="linebreak">
  309.   <br/>
  310. </xsl:template>
  311.  
  312. <xsl:template match="linegroup">
  313.   <p><xsl:apply-templates/></p>
  314. </xsl:template>
  315.  
  316. <xsl:template match="attribution">
  317.   <div align="right"><xsl:apply-templates/></div>
  318. </xsl:template>
  319.  
  320. <!-- START ELEMENT TABLE -->
  321. <xsl:template match="elmtbl">
  322.   <table border="1">
  323.     <xsl:for-each select="datatype">
  324.       <xsl:variable name="thisPosition" select="position()"/>
  325.       <tr>
  326.         <xsl:apply-templates select="."/>
  327.         <xsl:apply-templates 
  328.           select="../datavalue[position() = $thisPosition]"/>
  329.       </tr>
  330.     </xsl:for-each>
  331.   </table>
  332. </xsl:template>
  333.  
  334. <xsl:template match="countrystat">
  335.   <table>
  336.     <xsl:for-each select="datavalue">
  337.       <xsl:variable name="thisPosition" select="position()"/>
  338.       <tr>
  339.         <xsl:apply-templates select="../info[position() = $thisPosition]"/>
  340.         <xsl:apply-templates select="../datavalue[position() = $thisPosition]"/>
  341.       </tr>
  342.     </xsl:for-each>
  343.   </table>
  344. </xsl:template>
  345.  
  346. <xsl:template match="info">
  347.   <td width="110"><xsl:apply-templates/></td>
  348. </xsl:template>
  349.  
  350. <xsl:template match="datatype | datavalue">
  351.   <td><xsl:apply-templates/></td>
  352. </xsl:template>
  353.  
  354. <!-- END ELEMENT TABLE -->
  355.  
  356. <xsl:template match="table">
  357.   <table border="1">
  358.     <xsl:apply-templates/>
  359.   </table>
  360. </xsl:template>
  361.  
  362. <xsl:template match="tablehd">
  363.   <caption><xsl:apply-templates/></caption>
  364. </xsl:template>
  365.  
  366. <xsl:template match="tablefoot">
  367.   <tr><xsl:apply-templates/></tr>
  368. </xsl:template>
  369.  
  370. <xsl:template match="row">
  371.   <tr><xsl:apply-templates/></tr>
  372. </xsl:template>
  373.  
  374. <xsl:template match="cell">
  375.   <td><xsl:apply-templates/></td>
  376. </xsl:template>
  377.  
  378. <!-- start P and firstpar elements -->
  379.  
  380. <!-- note: for next two templates, don't generate thumbnails for inline
  381.      images (@ty='i') -->
  382.  
  383. <xsl:template match="p">
  384.  
  385.     <xsl:if test="descendant::asset[not(parent::inline) and @thumbwdth > 0]">
  386.       <table align="left" width="120" cellspacing="0" cellpadding="0" border="0"><tr>
  387.         <td width="110" valign="top"><xsl:apply-templates select="descendant::assembly" mode="thumb"/></td>
  388.         <td width="10"/>
  389.       </tr></table>
  390.     </xsl:if>
  391.     <p><xsl:apply-templates/>
  392.     <xsl:choose>
  393.       <xsl:when test="not(following-sibling::p)"><br clear="all"/></xsl:when>
  394.       <xsl:when test="following-sibling::p[position() = 1]/descendant::asset[not(parent::inline) and @thumbwdth > 0]"><br clear="all"/></xsl:when>
  395.     </xsl:choose>
  396.     </p>
  397.   </xsl:template>
  398.  
  399.  
  400.  
  401. <xsl:template match="fpartxt">
  402.  
  403.     <xsl:if test="..//asset[not(parent::inline) and @thumbwdth > 0]">
  404.       <table align="left" width="120" cellspacing="0" cellpadding="0" border="0"><tr>
  405.         <td width="110" valign="top"><xsl:apply-templates select="..//assembly" mode="thumb"/></td>
  406.         <td width="10"/>
  407.       </tr></table>
  408.     </xsl:if>
  409.     <p>
  410.          <!-- this is to fix bcd's bug2394.
  411.             xhtml output method which uses by bcd converts<i></i> to<i/> which displays italics text for
  412.             most articles. html output method which uses by site leaves the xsl output to <i></i> if it's 
  413.             empty and there is no display problem. karen 
  414.                                                                                                                                                                                                                                                                      -->
  415.         <xsl:if test="//tvtype or //tvarint or tvcnjtive">
  416.         <i><xsl:apply-templates select="//tvtype | //tvarint | //tvcnjtive" mode="tvar"/></i>
  417.         </xsl:if>
  418.  
  419.     <xsl:apply-templates/>
  420.     <xsl:choose>
  421.       <xsl:when test="not(parent::node()/following-sibling::p)"><br clear="all"/></xsl:when>
  422.       <xsl:when test="parent::node()/following-sibling::p[position() = 1]/descendant::asset[not(parent::inline) and @thumbwdth > 0]"><br clear="all"/></xsl:when>
  423.     </xsl:choose>
  424.     </p>
  425.   </xsl:template>
  426.  
  427. <!-- end firstpar -->
  428.  
  429. <!-- end P and firstpar elements -->
  430.  
  431. <xsl:template match="assembly">
  432.   <a>
  433.     <xsl:attribute name="href"><xsl:value-of select="$assemblyURL"/>?assemblyId=<xsl:value-of select="@id"/>&type=A</xsl:attribute>
  434.     <xsl:apply-templates select="arttext"/>
  435.   </a>
  436. </xsl:template>
  437.  
  438.   <xsl:template match="assembly" mode="thumb">
  439.     <p>
  440.     <a>
  441.       <xsl:attribute name="href"><xsl:value-of select="$assemblyURL"/>?assemblyId=<xsl:value-of select="@id"/>&type=A</xsl:attribute>
  442.     <xsl:for-each select="asset">
  443.       <xsl:if test="position()=1 and @thumbwdth > 0">
  444.         <xsl:call-template name="regular_thumb"/>
  445.         <br/>
  446.       </xsl:if>
  447.     </xsl:for-each>
  448.     </a>
  449.     <xsl:apply-templates select="thumbcap">
  450.      <xsl:with-param name="parsed">true</xsl:with-param>
  451.     </xsl:apply-templates>
  452.     </p>  
  453.   </xsl:template>
  454.  
  455.   <xsl:template match="authcr">
  456.    <!-- surpress the author link if it's editor of EB -->
  457.     <xsl:if test="@persid != ''">
  458.     
  459.     <a>
  460.       <xsl:attribute name="href"><xsl:value-of select="$authorURL"/>?authorId=<xsl:value-of select="@persid"/></xsl:attribute>
  461.       <xsl:apply-templates/>
  462.     </a>
  463.         
  464.     </xsl:if><br/><br/>
  465.   </xsl:template>
  466.  
  467.   <xsl:template match="signature">
  468.     <a>
  469.       <xsl:attribute name="href"><xsl:value-of select="$authorURL"/>?authorId=<xsl:value-of select="@persid"/></xsl:attribute>
  470.       <xsl:apply-templates/>
  471.     </a>
  472.  
  473.   </xsl:template>
  474.  
  475. <!-- bdate -->
  476. <xsl:template match="bdate">
  477.   <b>
  478.     <xsl:apply-templates select="/article/title/uninvrtitl"/><br/>
  479.     <xsl:choose>
  480.     <xsl:when test="@ty='fl'"> flourished <xsl:apply-templates/></xsl:when>
  481.     <xsl:when test="@ty='bap'"> baptized <xsl:apply-templates/> </xsl:when>
  482.     <xsl:otherwise> born <xsl:apply-templates/> </xsl:otherwise>
  483.     </xsl:choose>
  484.   </b><br/>
  485.   <xsl:if test="not(../ddate)"><br/></xsl:if>
  486. </xsl:template>
  487.  
  488. <xsl:template match="loc">, <xsl:apply-templates/></xsl:template>
  489.  
  490. <!-- end bdate -->
  491.  
  492. <!-- ddate -->
  493. <xsl:template match="ddate">
  494.   <b>
  495.     <xsl:choose>
  496.       <xsl:when test="@ty='kill'"> killed in action <xsl:apply-templates/> </xsl:when>
  497.     <xsl:when test="@ty='bur'"> buried <xsl:apply-templates/> </xsl:when>
  498.     <xsl:when test="@ty='found'"> found dead <xsl:apply-templates/> </xsl:when>
  499.     <xsl:otherwise> died <xsl:apply-templates/> </xsl:otherwise>
  500.     </xsl:choose>
  501.   </b>
  502.   <br/>
  503. </xsl:template>
  504.  
  505. <!-- first two head levels requir expanded node set for bboy -->
  506. <xsl:template match="h1">
  507.   <h2>
  508.     <a>
  509.       <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  510.     <xsl:apply-templates select="headtitle"/>
  511.     </a>
  512.   </h2>
  513.     <!-- do recursive call instead of selecting element. that will fix the empty article page tocid=4789. 
  514.             in tocid 4789, h1 has bibp child only and since the bibp is not in the select value,so there is 
  515.             an empty article page. I changed to apply-templates to fix this 
  516.  
  517.             karen 
  518.     -->
  519.   <!--xsl:apply-templates select="h2|p|list|qt|poetry|table|authcr|class"/-->
  520.     <xsl:apply-templates select="*[name() != 'headtitle']"/>
  521. </xsl:template>
  522.  
  523. <xsl:template match="h2">
  524.   <h3>
  525.     <a>
  526.       <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  527.     <xsl:apply-templates select="headtitle"/>
  528.     </a>
  529.   </h3>
  530.   <!--xsl:apply-templates select="h3|p|list|qt|poetry|table|authcr|class"/-->
  531.     <xsl:apply-templates select="*[name() != 'headtitle']"/>
  532. </xsl:template>
  533.  
  534. <xsl:template match="h3">
  535.   <h4>
  536.     <a>
  537.       <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  538.     <xsl:apply-templates select="headtitle"/>
  539.     </a>
  540.   </h4>
  541.   <!--xsl:apply-templates select="p|h4|authcr|class"/-->
  542.     <xsl:apply-templates select="*[name() != 'headtitle']"/>
  543. </xsl:template>
  544.  
  545. <xsl:template match="h4">
  546.   <h5>
  547.     <a>
  548.       <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  549.       <xsl:apply-templates select="headtitle"/>
  550.     </a>
  551.   </h5>
  552.   <!--xsl:apply-templates select="p|h5|authcr|class"/-->
  553.     <xsl:apply-templates select="*[name() != 'headtitle']"/>
  554. </xsl:template>
  555.  
  556. <xsl:template match="h5">
  557.   <h5>
  558.     <a>
  559.       <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  560.       <xsl:apply-templates select="headtitle"/>
  561.     </a>
  562.   </h5>
  563.   <!--xsl:apply-templates select="p|authcr|class"/-->
  564.     <xsl:apply-templates select="*[name() != 'headtitle']"/>
  565. </xsl:template>
  566.  
  567. <xsl:template match="class">
  568.   <xsl:apply-templates select="tax1"/>
  569. </xsl:template>
  570.  
  571. <xsl:template match="tax1">
  572.   <xsl:if test="label/labeltxt">
  573.      <xsl:call-template name="class"/>
  574.   </xsl:if>
  575.  <xsl:apply-templates select="tax2"/>
  576. </xsl:template>
  577.  
  578. <xsl:template match="tax2">
  579.   <xsl:if test="label/labeltxt">
  580.      <p style="margin-left: 1%"><xsl:call-template name="class"/></p>
  581.   </xsl:if>
  582.  <xsl:apply-templates select="tax3"/>
  583. </xsl:template>
  584.  
  585. <xsl:template match="tax3">
  586.   <xsl:if test="label/labeltxt">
  587.      <p style="margin-left:1.5%"><xsl:call-template name="class"/></p>
  588.   </xsl:if>
  589.  <xsl:apply-templates select="tax4"/>
  590. </xsl:template>
  591.  
  592. <xsl:template match="tax4">
  593.   <xsl:if test="label/labeltxt">
  594.      <p style="margin-left:2%"><xsl:call-template name="class"/></p>
  595.   </xsl:if>
  596.  <xsl:apply-templates select="tax5"/>
  597. </xsl:template>
  598.  
  599. <xsl:template match="tax5">
  600.  <xsl:if test="label/labeltxt">
  601.      <p style="margin-left:2.5%"><xsl:call-template name="class"/></p>
  602.   </xsl:if>
  603.  <xsl:apply-templates select="tax6"/>
  604. </xsl:template>
  605.  
  606. <xsl:template match="tax6">
  607.  <xsl:if test="label/labeltxt">
  608.      <p style="margin-left:3%"><xsl:call-template name="class"/></p>
  609.   </xsl:if>
  610. </xsl:template>
  611.  
  612. <xsl:template name="class">
  613.  
  614.    <b> 
  615.       <span class="artcopy"><xsl:apply-templates select="label/labeltxt"/></span>
  616.       <span class="artcopy"><xsl:apply-templates select="label/commonname"/></span>
  617.    </b><br/>
  618.    <xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text><span class="artcopy"><xsl:apply-templates select="desc"/></span>
  619.  
  620.  </xsl:template>
  621.  
  622. <xsl:template match="labeltxt">
  623.  <xsl:apply-templates/>
  624. </xsl:template>
  625.  
  626. <xsl:template match="commonname">
  627.  <xsl:apply-templates/>
  628. </xsl:template>
  629.  
  630. <xsl:template match="desc">
  631.  <xsl:apply-templates/>
  632. </xsl:template>
  633.  
  634. <!-- mwks process -->
  635. <xsl:template match="mwks">
  636.   <xsl:choose>
  637.     <xsl:when test="@ty='rep'">
  638.       <h2>Representative Works:</h2>
  639.     </xsl:when>
  640.     <xsl:otherwise>
  641.       <h2>Major Works:</h2>
  642.     </xsl:otherwise>
  643.   </xsl:choose>
  644.   <p>
  645.     <a>
  646.       <xsl:attribute name="name"><xsl:value-of select="@tocid"/>&tocid=<xsl:value-of select="@tocid"/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  647.       <xsl:apply-templates/>
  648.     </a>
  649.   </p>
  650. </xsl:template>
  651.  
  652. <xsl:template match="bibp">
  653.     <xsl:choose>
  654.       <xsl:when test="citation">
  655.         <xsl:for-each select="citation">
  656.           <ul><xsl:apply-templates/></ul>
  657.         </xsl:for-each>
  658.       </xsl:when>
  659.       <xsl:otherwise>
  660.         <span class="artcopy"><xsl:apply-templates/></span>
  661.       </xsl:otherwise>
  662.     </xsl:choose><p/>
  663.   </xsl:template>
  664.  
  665. <xsl:template match="gh1">
  666.   <p>
  667.     <h3>
  668.       <a>
  669.         <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  670.       <xsl:apply-templates select="headtitle"/>
  671.       </a>
  672.     </h3>
  673.     <xsl:apply-templates select="bibp|gh2"/>
  674.  
  675.     <!-- put 1.5 fix here -->
  676.  
  677.     <xsl:if test="authcr">
  678.       <br><xsl:apply-templates select="authcr"/></br>
  679.     </xsl:if>
  680.  
  681.   </p>
  682. </xsl:template>
  683.  
  684. <xsl:template match="gh2">
  685.   <p>
  686.     <h4>
  687.       <a>
  688.         <xsl:attribute name="name"><xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  689.       <xsl:apply-templates select="headtitle"/>
  690.     </a>
  691.     </h4>
  692.     <xsl:apply-templates select="bibp"/>
  693.  
  694.     <!-- put 1.5 fix here -->
  695.  
  696.    <xsl:if test="authcr">
  697.      <br><xsl:apply-templates select="authcr"/></br>
  698.    </xsl:if>
  699.  
  700.   </p>
  701. </xsl:template>
  702.  
  703. <!-- end mwks process -->
  704.  
  705. <xsl:template match="biblio">
  706.   <h2>Additional reading</h2>
  707.   <p>
  708.     <a>
  709.       <xsl:attribute name="name"><xsl:value-of select="@euid"/>&tocid=<xsl:value-of select="@tocid"/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  710.     <xsl:apply-templates/>
  711.     </a>
  712.   </p>
  713. </xsl:template>
  714.  
  715. <!-- new element for ebi's bibp -->
  716. <xsl:template match="bibsubhead">
  717.     <h3><xsl:apply-templates/></h3>
  718. </xsl:template>
  719.  
  720. <!-- new element for ebi's bibp -->
  721. <xsl:template match="bibxref">
  722.     <xsl:apply-templates/>
  723. </xsl:template>
  724.  
  725. <!-- not sure what this is for -->
  726. <xsl:template match="cdate/p">
  727.   <xsl:if test="descendant::asset[not(parent::inline)]">
  728.     <table align="left" width="120" cellspacing="0" cellpadding="0" border="0">
  729.       <tr>
  730.         <td width="110" valign="top">
  731.           <xsl:apply-templates select="descendant::assembly" mode="thumb"/> 
  732.       </td>
  733.       <td width="10">
  734.       </td>
  735.     </tr>
  736.     </table>
  737.   </xsl:if>
  738.  
  739.   <p>
  740.     <xsl:if test="position() = 1">
  741.       <font color="#660000">
  742.         <b><xsl:value-of select="../@value"/></b>
  743.       </font>
  744.       <xsl:text> </xsl:text>
  745.     </xsl:if>
  746.     <xsl:apply-templates/>
  747.   </p>
  748. </xsl:template>
  749.  
  750.   <xsl:template match="event">
  751.     <!-- not sure if we need to do this -->
  752.   </xsl:template>
  753.  
  754.   <!-- btw backref stuff -->
  755.   <xsl:template match="backref">
  756.     <xsl:apply-templates select="xref">
  757.       <xsl:with-param name="text">Return to article</xsl:with-param>
  758.     </xsl:apply-templates>
  759.   </xsl:template>
  760.  
  761.   <xsl:template match="sourcelist">
  762.     <p>
  763.     <xsl:apply-templates select="sourcehead"/>
  764.     <ul>
  765.     <xsl:for-each select="source">
  766.       <xsl:apply-templates/>
  767.     </xsl:for-each>
  768.     </ul>
  769.     </p>       
  770.   </xsl:template>
  771.  
  772.   <xsl:template match="source">
  773.     <li><xsl:apply-templates/></li>
  774.   </xsl:template>
  775.  
  776.   <!-- classics stuff -->
  777.   <xsl:template match="byline">
  778.     <h4>by <xsl:apply-templates/></h4>
  779.   </xsl:template>
  780.  
  781.   <xsl:template match="prefnote">
  782.     <h5><xsl:apply-templates/></h5>
  783.   </xsl:template>
  784.  
  785.   <xsl:template match="classicbody">
  786.    <!-- per Core meeting, not to output this text. bug# 853 -->
  787.     <!--p><b><xsl:value-of select="@name"/></b></p-->
  788.  
  789.     <!-- it's important to implement the following tag exactly, as it will later be matched in a regular expression -->
  790.     <classic tocid="{@tocid}"></classic>
  791.   </xsl:template>
  792.  
  793.   <xsl:template match="note">
  794.     <h5><xsl:apply-templates/></h5>
  795.   </xsl:template>
  796.  
  797.   <xsl:template match="gp">
  798.     <xsl:apply-templates/><br/>
  799.   </xsl:template>
  800.  
  801.   <xsl:template match="reference">
  802.     <i><xsl:apply-templates/></i>
  803.   </xsl:template>
  804.  
  805.   <xsl:template match="pubdate">
  806.     <xsl:apply-templates/>
  807.   </xsl:template>
  808.  
  809.  
  810.   <!-- xsl for flag history article type -->
  811.   <xsl:template match="flaghistory">
  812.     <html>
  813.     <head>
  814.       <title><xsl:apply-templates select="title/titltxt"/></title>
  815.     </head>
  816.     <body>
  817.       <xsl:apply-templates/>
  818.     </body>
  819.     </html>
  820.   </xsl:template>
  821.  
  822.   <xsl:template match="titltxt">
  823.     <xsl:apply-templates/>
  824.   </xsl:template>
  825.  
  826.   <xsl:template match="titlsub">
  827.     <xsl:apply-templates/>
  828.   </xsl:template>
  829.  
  830.     <xsl:template match="courtcase">
  831.   <i><xsl:apply-templates select="party1"/></i> v. <i><xsl:apply-templates select="party2"/></i>
  832. </xsl:template>
  833.  
  834.   <xsl:template match="description">
  835.     <xsl:apply-templates/>
  836.   </xsl:template>
  837.  
  838.   <xsl:template match="flagimg">
  839.     <xsl:call-template name="regular_fullsize">
  840.             <xsl:with-param name="alt">flag</xsl:with-param>
  841.         </xsl:call-template><br/>
  842.   </xsl:template>
  843.  
  844.   <xsl:template match="desctxt">
  845.     <p><xsl:apply-templates/></p>
  846.   </xsl:template>
  847.  
  848.   <xsl:template match="frac">
  849.     <xsl:text> </xsl:text><xsl:apply-templates select="num"/>/<xsl:apply-templates select="den"/>
  850.   </xsl:template>
  851.  
  852. </xsl:stylesheet>
  853.