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