home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / oec2-lib.jar / xsl / cd / shared / ArticleRefLinks.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-25  |  4.0 KB  |  101 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.  
  11. <!-- Start idxref -->
  12. <xsl:template match="idxref[$printable = 'false']">
  13.   <xsl:choose>
  14.     <xsl:when test="ancestor::title">
  15.       <xsl:apply-templates/>
  16.     </xsl:when>
  17.  
  18.     <xsl:when test="xref[@tocid]">
  19.         <!--    site has idxref then xref
  20.         no need to create idxref link since a link will be created by xref template later.
  21.         e.g. is Joseph Patrick Kennedy link of early life of John Kennedy article. --> 
  22.       <xsl:apply-templates/>
  23.     </xsl:when>
  24.  
  25.     <xsl:when test="ancestor::xref">
  26.         <!-- bcddev has xref then idxref
  27.         no need to create idxref link since a link will be created by xref template later.
  28.         e.g. is Joseph Patrick Kennedy link of early life of John Kennedy article. --> 
  29.       <xsl:apply-templates/>
  30.     </xsl:when>
  31.  
  32. <xsl:otherwise>
  33.     <a>
  34.       <xsl:attribute name="href"><xsl:value-of select="$articleURL"/>?articleId=<xsl:value-of select="$artId"/>#<xsl:value-of select="@ref"/>.hook</xsl:attribute>
  35.       <!--<xsl:attribute name="name"><xsl:value-of select="@ref"/>.hook</xsl:attribute>-->
  36.       
  37.         <!-- &idxref=<xsl:value-of select="@ref"/></xsl:attribute><xsl:attribute name="name"><xsl:value-of select="@ref"/>.hook -->      
  38.       <xsl:apply-templates/>
  39.     </a>
  40.     </xsl:otherwise>
  41.   </xsl:choose>
  42. </xsl:template>
  43.  
  44. <!-- matches to EUs, for some xrefs  -->
  45. <xsl:template match="xref[@ty='1' and $printable = 'false']">
  46.   <xsl:param name="text"></xsl:param>
  47.   <xsl:choose>
  48.     <xsl:when test="ancestor::title">
  49.       <xsl:apply-templates/>
  50.     </xsl:when>
  51.     <xsl:when test="ancestor::imgmap">
  52.       <a>
  53.         <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/>&tocId=<xsl:value-of select="@tocid"/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  54.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  55.       </a>
  56.     </xsl:when>
  57.     <xsl:otherwise>
  58.       <a>
  59.         <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/>&tocId=<xsl:value-of select="@tocid"/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  60.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  61.       </a>
  62.     </xsl:otherwise>
  63.   </xsl:choose>
  64. </xsl:template>
  65.  
  66. <!-- matches to ref points -->
  67. <xsl:template match="xref[@ty='2' and $printable = 'false']">
  68.   <xsl:param name="text"></xsl:param>
  69.   <xsl:choose>
  70.     <xsl:when test="ancestor::title">
  71.       <xsl:apply-templates/>
  72.     </xsl:when>
  73.     <xsl:otherwise>
  74.       <a>
  75.         <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>
  76.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  77.       </a>
  78.     </xsl:otherwise>
  79.   </xsl:choose>
  80. </xsl:template>
  81.  
  82. <!-- matches to toc levels -->
  83. <xsl:template match="xref[@ty='3' and $printable = 'false']">
  84.   <xsl:param name="text"></xsl:param>
  85.   <xsl:choose>
  86.     <xsl:when test="ancestor::title">
  87.       <xsl:apply-templates/>
  88.     </xsl:when>
  89.     <xsl:otherwise>
  90.       <a>
  91.         <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/>&tocId=<xsl:value-of select="@tocid"/>#<xsl:value-of select="@tocid"/>.toc</xsl:attribute>
  92.         <xsl:value-of select="$text"/><xsl:apply-templates/>
  93.       </a>
  94.     </xsl:otherwise>
  95.   </xsl:choose>
  96. </xsl:template>
  97.  
  98.   
  99.  
  100. </xsl:stylesheet>
  101.