home *** CD-ROM | disk | FTP | other *** search
/ Encyclopaedia Britannica …oncise Encyclopedia 2007 / bcd_concise07.iso / data / jars / oec2-lib.jar / xsl / shared / summary / simpleSummary.xsl
Encoding:
Extensible Markup Language  |  2006-08-25  |  2.5 KB  |  102 lines

  1. <!DOCTYPE xsl:stylesheet [
  2.   <!ENTITY nbsp "<xsl:text disable-output-escaping='yes'>&nbsp;</xsl:text>">
  3. ]>
  4.  
  5. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6.     version="1.0">
  7.  
  8.     <xsl:output method="html" />
  9.  
  10.     <xsl:template match="firstparagraph">
  11.         <!-- xsl:apply-templates select="title" / -->
  12.             <xsl:apply-templates select="firstart" />
  13.             <xsl:apply-templates select="body" />
  14.     </xsl:template>
  15.  
  16.  
  17.     <xsl:template match="title">
  18.         <xsl:choose>
  19.             <xsl:when
  20.                 test="starts-with(../articleinfo/@contenttype, 'boy')">
  21.                 <div class="copyboldlink">
  22.                     Year in Review
  23.                     <xsl:value-of
  24.                         select="substring(../articleinfo/@contenttype, 4, 4)" />
  25.                     :
  26.                     <xsl:value-of
  27.                         select="../articleinfo/@contentsubtype" />
  28.                 </div>
  29.                 <xsl:apply-templates />
  30.             </xsl:when>
  31.             <xsl:otherwise>
  32.                 <xsl:apply-templates />
  33.             </xsl:otherwise>
  34.         </xsl:choose>
  35.     </xsl:template>
  36.  
  37.     <xsl:template match="titltxt">
  38.         <xsl:apply-templates mode="text_mode" />
  39.     </xsl:template>
  40.  
  41.     <xsl:template match="tabbrev|chemsym">
  42.         (<xsl:apply-templates />)
  43.     </xsl:template>
  44.  
  45.     <xsl:template match="firstart" />
  46.  
  47.     <xsl:template match="asset" />
  48.     <xsl:template match="body">
  49.         <xsl:variable name="parsedbody">
  50.             <xsl:apply-templates mode="text_mode" />
  51.         </xsl:variable>
  52.  
  53.         <div class="featcopy">
  54.             <xsl:choose>
  55.                 <xsl:when test="string-length($parsedbody) > 400">
  56.                     <xsl:call-template name="getgist">
  57.                         <xsl:with-param name="gistbody"
  58.                             select="$parsedbody" />
  59.                     </xsl:call-template>
  60.                     ...
  61.                 </xsl:when>
  62.                 <xsl:otherwise>
  63.                     <xsl:value-of select="$parsedbody"
  64.                         disable-output-escaping="no" />
  65.                 </xsl:otherwise>
  66.             </xsl:choose>
  67.         </div>
  68.     </xsl:template>
  69.  
  70.     <xsl:template name="getgist">
  71.         <xsl:param name="charposition" select="400" />
  72.         <xsl:param name="gistbody" />
  73.         <xsl:choose>
  74.             <xsl:when
  75.                 test="substring($gistbody,$charposition,1) = ' '">
  76.                 <xsl:value-of
  77.                     select="substring($gistbody,1,$charposition)"
  78.                     disable-output-escaping="no" />
  79.             </xsl:when>
  80.             <xsl:otherwise>
  81.                 <xsl:call-template name="getgist">
  82.                     <xsl:with-param name="charposition"
  83.                         select="$charposition - 1" />
  84.                     <xsl:with-param name="gistbody" select="$gistbody" />
  85.                 </xsl:call-template>
  86.             </xsl:otherwise>
  87.         </xsl:choose>
  88.     </xsl:template>
  89.  
  90.     <xsl:template match="charundef | charemph | charfont"
  91.         mode="text_mode">
  92.         <xsl:value-of select="@char" />
  93.         <xsl:apply-templates mode="text_mode" />
  94.     </xsl:template>
  95.  
  96.     <xsl:template match="*" mode="text_mode">
  97.         <xsl:apply-templates mode="text_mode" />
  98.     </xsl:template>
  99.  
  100.  
  101. </xsl:stylesheet>
  102.