home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _1D5D933325874C4D8C28AEDAC91BF5CB < prev    next >
Encoding:
Extensible Markup Language  |  2002-10-21  |  7.0 KB  |  236 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- 
  3. TEI XSLT stylesheet family version 1.2
  4. XSL stylesheet to format TEI XML documents to HTML or XSL FO
  5.  
  6. This structured  bibliography handling comes from 
  7. Peter Boot <pboot@attglobal.net>
  8.  
  9. Copyright 2000-2002
  10.   Sebastian Rahtz/Oxford University  <sebastian.rahtz@oucs.ox.ac.uk>
  11.  
  12.  Permission is hereby granted, free of charge, to any person obtaining
  13.  a copy of this software and any associated documentation files (the
  14.  ``Software''), to deal in the Software without restriction, including
  15.  without limitation the rights to use, copy, modify, merge, publish,
  16.  distribute, sublicense, and/or sell copies of the Software, and to
  17.  permit persons to whom the Software is furnished to do so, subject to
  18.  the following conditions:
  19.  
  20.  The above copyright notice and this permission notice shall be included
  21.  in all copies or substantial portions of the Software.
  22.  
  23. --> 
  24. <xsl:stylesheet
  25.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  26.   version="1.0">
  27.  
  28. <xsl:template match="biblStruct" mode="header">
  29.  <xsl:choose>
  30.         <xsl:when test="descendant::author">
  31.             <xsl:apply-templates select="descendant::author[position()=1]" mode="first"/>
  32.         </xsl:when>
  33.         <xsl:otherwise>
  34.             <xsl:apply-templates select="descendant::editor[position()=1]" mode="first"/>
  35.         </xsl:otherwise>
  36.     </xsl:choose>
  37.     <xsl:choose>
  38.         <xsl:when test="descendant::title[@type='short']">
  39.             <xsl:apply-templates select="descendant::title[@type='short']"/>
  40.         </xsl:when>
  41.         <xsl:otherwise>
  42.             <xsl:apply-templates select="descendant::title[@type='main'][1]"/>
  43.         </xsl:otherwise>
  44.     </xsl:choose>
  45. </xsl:template>
  46.  
  47. <xsl:template match="biblStruct">
  48.     <a name="{@id}"></a>
  49.     <xsl:choose>
  50.         <xsl:when test="@copyOf">
  51.             <a class="biblink" href="{concat('#',substring(@copyOf,5,2))}">Zie <xsl:value-of select="substring(@copyOf,5,2)"/></a>
  52.         </xsl:when>
  53.         <xsl:otherwise>
  54.             <xsl:choose>
  55.                 <xsl:when test="descendant::analytic">
  56.                     <br/><xsl:apply-templates select="analytic"/>
  57.                     <center>
  58.                     <table width="90%" border="0">
  59.                     <xsl:apply-templates select="monogr" mode="monograll"/>
  60.                     </table>
  61.                     </center>
  62.                 </xsl:when>
  63.                 <xsl:otherwise>
  64.                     <br/><xsl:apply-templates select="monogr" mode="monogrfirst"/>
  65.                     <center>
  66.                     <table width="90%" border="0">
  67.                     <xsl:apply-templates select="monogr" mode="monogrrest"/>
  68.                     </table>
  69.                     </center>
  70.                 </xsl:otherwise>
  71.             </xsl:choose>
  72.         </xsl:otherwise>
  73.     </xsl:choose>
  74. </xsl:template>
  75.  
  76. <xsl:template match="analytic">
  77.     <xsl:apply-templates select="author" mode="biblStruct"/>
  78.     <i><xsl:apply-templates select="title[not(@type='short')]" mode="withbr"/></i>
  79. </xsl:template>
  80.  
  81. <xsl:template match="monogr" mode="monograll">
  82.     <tr><td>
  83.         <xsl:choose>
  84.             <xsl:when test="preceding-sibling::monogr">
  85.                 Also in:
  86.             </xsl:when>
  87.             <xsl:otherwise>
  88.                 In:
  89.             </xsl:otherwise>
  90.         </xsl:choose>
  91.     </td></tr>
  92.     <tr><td>
  93.     <xsl:apply-templates select="author" mode="biblStruct"/>
  94.     <i><xsl:apply-templates select="title" mode="withbr"/></i>
  95.     <xsl:apply-templates select="respStmt"/>
  96.     <xsl:apply-templates select="editor"/>
  97.     <xsl:apply-templates select="edition"/>
  98.     <xsl:apply-templates select="imprint"/>
  99.     </td></tr>
  100.     <tr><td>
  101.     <xsl:apply-templates select="biblScope"/>
  102.     </td></tr>
  103.     <xsl:apply-templates select="following-sibling::series"/>
  104. </xsl:template>
  105.  
  106. <xsl:template match="monogr" mode="monogrfirst">
  107.     <xsl:apply-templates select="author" mode="biblStruct"/>
  108.     <i><xsl:apply-templates select="title[not(@type='short')]" mode="withbr"/></i>
  109. </xsl:template>
  110.  
  111. <xsl:template match="monogr" mode="monogrrest">
  112.     <tr><td>
  113.     <xsl:apply-templates select="respStmt"/>
  114.     <xsl:apply-templates select="editor"/>
  115.     <xsl:apply-templates select="edition"/>
  116.     <xsl:apply-templates select="imprint"/>
  117.     <xsl:if test="child::note">
  118.         Zie noot: <xsl:apply-templates select="child::note"/>
  119.     </xsl:if>
  120.     </td></tr>
  121.     <tr><td>
  122.     <xsl:apply-templates select="biblScope"/>
  123.     </td></tr>
  124.     <xsl:apply-templates select="following-sibling::series"/>
  125. </xsl:template>
  126.  
  127. <xsl:template match="series">
  128.     <tr><td><xsl:apply-templates/></td></tr>
  129. </xsl:template>
  130.  
  131. <xsl:template match="author" mode="biblStruct">
  132.     <xsl:value-of select="name/@reg"/><xsl:for-each select="name[position()>1]">, <xsl:apply-templates/></xsl:for-each>.<br/>
  133. </xsl:template>
  134.  
  135. <xsl:template match="author" mode="first">
  136.     <xsl:value-of select="name/@reg"/>
  137.     <xsl:if test="name[position()>1]"><xsl:text> (e.a.)</xsl:text></xsl:if><xsl:text>: </xsl:text>
  138. </xsl:template>
  139.  
  140. <xsl:template match="editor" mode="first">
  141.     <xsl:value-of select="name/@reg"/>
  142.     <xsl:text> (ed.)</xsl:text>
  143.     <xsl:if test="name[position()>1]"><xsl:text> (e.a.)</xsl:text></xsl:if><xsl:text>: </xsl:text>
  144. </xsl:template>
  145.  
  146. <xsl:template match="imprint">
  147.     <xsl:apply-templates select="biblScope"/>
  148.     <xsl:apply-templates select="pubPlace"/>, 
  149.     <xsl:apply-templates select="date"/>. <xsl:apply-templates select="publisher"/>
  150. </xsl:template>
  151.  
  152. <xsl:template match="publisher">
  153.     (<xsl:apply-templates/>).
  154. </xsl:template>
  155.  
  156. <xsl:template match="edition">
  157.     <xsl:apply-templates/>.<br/>
  158. </xsl:template>
  159.  
  160. <xsl:template match="biblScope">
  161.     <xsl:apply-templates/>
  162.     <xsl:if test="ancestor::biblStruct">. </xsl:if>
  163. </xsl:template>
  164.  
  165. <xsl:template match="editor">
  166.     <xsl:apply-templates select="name[position()=1]"/><xsl:for-each select="name[position()>1]">, <xsl:apply-templates/></xsl:for-each> (ed).<br/>
  167. </xsl:template>
  168.  
  169. <xsl:template match="respStmt">
  170.     <xsl:apply-templates select="resp"/> 
  171.     <xsl:for-each select="name[position()<last()]"><xsl:apply-templates/>, </xsl:for-each>
  172.     <xsl:apply-templates select="child::name[position()=last()]"/>.
  173.     <xsl:if test="ancestor::biblStruct">
  174.         <br/>
  175.     </xsl:if>
  176. </xsl:template>
  177.  
  178. <xsl:template match="resp">
  179.     <xsl:apply-templates/> 
  180. </xsl:template>
  181.  
  182. <xsl:template match="witList">
  183.     <xsl:apply-templates select="./witness"/>
  184. </xsl:template>
  185.  
  186. <xsl:template match="witness">
  187.     <p>
  188.         <a name="{@sigil}"></a>
  189.         <b>Sigle: <xsl:value-of select="@sigil"/></b><br/>
  190.         <xsl:value-of select="text()"/><br/>
  191.         <xsl:apply-templates select="biblStruct"/>
  192.         <xsl:if test="child::note">
  193.             <br/>Zie noot: <xsl:apply-templates select="child::note"/>
  194.         </xsl:if>
  195.     </p>
  196. </xsl:template>
  197.  
  198. <xsl:template match="listBibl">
  199. <ol>
  200.  <xsl:for-each select="bibl">
  201.   <li><xsl:apply-templates select="."/></li>
  202.  </xsl:for-each>
  203. </ol>
  204. </xsl:template>
  205.  
  206. <xsl:template match="bibl">
  207.    <xsl:variable name="ident">
  208.     <xsl:apply-templates select="." mode="ident"/>
  209.    </xsl:variable>
  210.    <a name="{$ident}"/>
  211.    <xsl:apply-templates/>
  212. </xsl:template>
  213.  
  214. <xsl:template match="bibl" mode="header">
  215. <xsl:text>[</xsl:text><xsl:number/><xsl:text>]</xsl:text>
  216. </xsl:template>
  217.  
  218. <xsl:template match="title" mode="withbr">
  219.   <xsl:value-of select="."/><br/>
  220. </xsl:template>
  221.  
  222. <xsl:template match="bibl/title">
  223.     <xsl:choose>
  224.         <xsl:when test="@rend='plain'">
  225.             <xsl:value-of select="."/>
  226.         </xsl:when>
  227.         <xsl:otherwise>
  228.             <i><xsl:value-of select="."/></i>
  229.         </xsl:otherwise>
  230.     </xsl:choose>
  231. </xsl:template>
  232.  
  233.  
  234. </xsl:stylesheet>
  235.  
  236.