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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet 
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     version="1.0">  
  6.     
  7.   <xsl:import href="../../shared/RefLinks.xsl"/>
  8.  
  9. <xsl:variable name="articleURL">ebcid:com.britannica.oec2.identifier.ArticleIdentifier</xsl:variable>
  10. <xsl:variable name="indexEntryURL">ebcid:com.britannica.oec2.identifier.IndexEntryContentIdentifier</xsl:variable>
  11.  
  12. <!-- Start idxref -->
  13. <xsl:template match="idxref[$printable = 'false']">
  14.   <xsl:choose>
  15.     <xsl:when test="ancestor::title">
  16.       <xsl:apply-templates/>
  17.     </xsl:when>
  18.  
  19.     <xsl:when test="xref[@tocid]">
  20.         <!--    site has idxref then xref
  21.         no need to create idxref link since a link will be created by xref template later.
  22.         e.g. is Joseph Patrick Kennedy link of early life of John Kennedy article. --> 
  23.       <xsl:apply-templates/>
  24.     </xsl:when>
  25.  
  26.     <xsl:when test="ancestor::xref">
  27.         <!-- bcddev has xref then idxref
  28.         no need to create idxref link since a link will be created by xref template later.
  29.         e.g. is Joseph Patrick Kennedy link of early life of John Kennedy article. --> 
  30.       <xsl:apply-templates/>
  31.     </xsl:when>
  32.  
  33. <xsl:otherwise>
  34.     <xsl:choose>
  35.         <xsl:when test="string-length(@idxstructid) >0">
  36.             <a> 
  37.                 <xsl:choose>            
  38.                     <xsl:when test="@product='boy'">
  39.                         <xsl:attribute name="href"><xsl:value-of select="$yearbooksURL"/>?idxStructId=<xsl:value-of select="@idxstructid"/>&library=EB</xsl:attribute>
  40.                         <xsl:attribute name="name"><xsl:value-of select="@ref"/>.hook</xsl:attribute>
  41.                     </xsl:when>
  42.                     <xsl:otherwise>
  43.                         <xsl:attribute name="href"><xsl:value-of select="$indexEntryURL"/>?idxStructId=<xsl:value-of select="@idxstructid"/>&library=EB</xsl:attribute>
  44.                         <xsl:attribute name="name"><xsl:value-of select="@ref"/>.hook</xsl:attribute>
  45.                     </xsl:otherwise>
  46.                 </xsl:choose>
  47.                 <xsl:apply-templates/>
  48.             </a>
  49.         </xsl:when>
  50.         <xsl:otherwise>
  51.             <xsl:apply-templates/>
  52.         </xsl:otherwise>
  53.      </xsl:choose>
  54.   </xsl:otherwise>
  55.   </xsl:choose>
  56. </xsl:template>
  57.  
  58. <!-- matches to EUs, for some xrefs  -->
  59. <xsl:template match="xref[@ty='1' and $printable = 'false']">
  60.   <xsl:param name="text"></xsl:param>
  61.   <xsl:choose>
  62.     <xsl:when test="ancestor::title">
  63.       <xsl:apply-templates/>
  64.     </xsl:when>
  65.     <xsl:when test="ancestor::imgmap">
  66.       <a>
  67.         <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="@artclid"/>&library=<xsl:value-of select="$ct"/>&query=<xsl:value-of select="$highlightQuery"/>&title=<xsl:apply-templates/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  68.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  69.       </a>
  70.     </xsl:when>
  71.     <xsl:otherwise>
  72.       <a>
  73.         <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="@artclid"/>&library=<xsl:value-of select="$ct"/>&query=<xsl:value-of select="$highlightQuery"/>&title=<xsl:apply-templates/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  74.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  75.       </a>
  76.     </xsl:otherwise>
  77.   </xsl:choose>
  78. </xsl:template>
  79.  
  80. <!-- matches to ref points -->
  81. <xsl:template match="xref[@ty='2' and $printable = 'false']">
  82.   <xsl:param name="text"></xsl:param>
  83.   <xsl:choose>
  84.     <xsl:when test="ancestor::title">
  85.       <xsl:apply-templates/>
  86.     </xsl:when>
  87.     <xsl:otherwise>
  88.       <a>
  89.         <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="@artclid"/>&library=<xsl:value-of select="$ct"/>&query=<xsl:value-of select="$highlightQuery"/>&title=<xsl:apply-templates/>#<xsl:value-of select="@refid"/>.ref</xsl:attribute>
  90.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  91.       </a>
  92.     </xsl:otherwise>
  93.   </xsl:choose>
  94. </xsl:template>
  95.  
  96. <!-- matches to toc levels -->
  97. <xsl:template match="xref[@ty='3' and $printable = 'false']">
  98.   <xsl:param name="text"></xsl:param>
  99.   <xsl:choose>
  100.     <xsl:when test="ancestor::title">
  101.       <xsl:apply-templates/>
  102.     </xsl:when>
  103.     <xsl:otherwise>
  104.       <a>
  105.         <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="@artclid"/>&library=<xsl:value-of select="$ct"/>&query=<xsl:value-of select="$highlightQuery"/>&title=<xsl:apply-templates/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  106.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  107.       </a>
  108.     </xsl:otherwise>
  109.   </xsl:choose>
  110. </xsl:template>
  111.  
  112.   
  113.  
  114. </xsl:stylesheet>
  115.