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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <xsl:stylesheet 
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:html="http://www.w3.org/TR/html4/loose.dtd"
  6.     xmlns:xhtml="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  7.     exclude-result-prefixes="html xhtml"
  8.     version="1.0">
  9.  
  10.   <xsl:import href="shared/basePage.xsl"/>
  11.   <xsl:import href="/xsl/shared/ArtAssembly.xsl"/>
  12.   <xsl:import href="shared/Variables.xsl"/>
  13.  
  14.   <xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="UTF-8"/>
  15.  
  16.   <xsl:template match="/">
  17.           <xsl:call-template name="pageTemplate">
  18.               <xsl:with-param name="pageTitle"><xsl:value-of select="assemblyXml/assemblyTitle"/></xsl:with-param>
  19.               <xsl:with-param name="pageHeading"><xsl:value-of select="assemblyXml/assemblyTitle"/></xsl:with-param>
  20.               <xsl:with-param name="pageSubheading"/>
  21.               <xsl:with-param name="pageBody"><xsl:apply-templates select="assemblyXml/asmbly"/></xsl:with-param>
  22.               <xsl:with-param name="relatedContentMenu"/>
  23.           </xsl:call-template>
  24.    </xsl:template>
  25.  
  26.   <xsl:template name="new_multimedia">
  27.     <xsl:variable name="stripped_filename">
  28.         <xsl:call-template name="strip_filename">
  29.             <xsl:with-param name="original" select="@filename"/>
  30.         </xsl:call-template>
  31.     </xsl:variable>
  32.     <xsl:choose>
  33.       <xsl:when test="@bintype='8'">
  34.         <xsl:if test="not(preceding-sibling::*/@bintype='9') and not(following-sibling::*/@bintype='9')">
  35.           <embed src="file://MEDIA/{$stripped_filename}" AutoStart="0" width="{@wdth}" height="{@hgt+10}"/>
  36.         </xsl:if>
  37.       </xsl:when>  
  38.       <xsl:when test="@bintype='5'">
  39.         <xsl:if test="not(preceding-sibling::*/@bintype='4') and not(following-sibling::*/@bintype='4')">
  40.           <embed src="file://MEDIA/{$stripped_filename}" width="{@wdth}" height="{@hgt}"/>
  41.         </xsl:if>
  42.       </xsl:when>
  43.       <xsl:when test="@bintype='25'">
  44.         <xsl:if test="not(preceding-sibling::*/@bintype='4') and not(following-sibling::*/@bintype='4')">
  45.           <embed src="file://MEDIA/{$stripped_filename}" AutoStart="0" width="{@wdth}" height="{@hgt+20}"/>
  46.         </xsl:if>
  47.       </xsl:when>
  48.       <xsl:when test="@bintype='20'">
  49.         <xsl:if test="not(preceding-sibling::*/@bintype='4') and not(following-sibling::*/@bintype='4')">
  50.           <embed src="file://MEDIA/{$stripped_filename}" AutoStart="0" width="{@wdth+300}" height="{@hgt+20}" type="audio/x-mpeg"/>
  51.         </xsl:if>
  52.       </xsl:when>
  53.       <xsl:otherwise><embed src="file://MEDIA/{$stripped_filename}" width="{@wdth}" height="{@hgt}"/></xsl:otherwise>
  54.     </xsl:choose>
  55.   </xsl:template>
  56.  
  57.   <xsl:template name="strip_filename">
  58.       <xsl:param name="original"/>
  59.       <xsl:choose>
  60.           <xsl:when test="contains($original,'/')">
  61.               <xsl:call-template name="strip_filename">
  62.                   <xsl:with-param name="original" select="substring-after($original, '/')"/>
  63.               </xsl:call-template>
  64.           </xsl:when>
  65.           <xsl:otherwise>
  66.               <xsl:value-of select="$original"/>
  67.           </xsl:otherwise>
  68.       </xsl:choose>
  69.   </xsl:template>
  70.  
  71.   <xsl:template name="img">
  72.     <img vspace="6">
  73.       <xsl:attribute name="arthref"><xsl:value-of select="$imageURL"/>?binaryId=<xsl:value-of select="@id"/></xsl:attribute>
  74.       <xsl:attribute name="height"><xsl:value-of select="@hgt"/></xsl:attribute>
  75.       <xsl:attribute name="width"><xsl:value-of select="@wdth"/></xsl:attribute>
  76.  
  77.       <!-- temporary hack until "name" attribute of the map element is fixed -->
  78.       <xsl:if test="@imgmap = 'y'">
  79.         <xsl:attribute name="usemap">#<xsl:value-of select="following-sibling::imgmap/map/@name"/></xsl:attribute>
  80.       </xsl:if>
  81.  
  82.       <xsl:attribute name="src"><xsl:value-of select="$imageURL"/>?binaryId=<xsl:value-of select="@id"/></xsl:attribute>
  83.     </img>
  84.   </xsl:template>
  85.  
  86.   <xsl:template match="mapcap">
  87.   </xsl:template>
  88.   
  89.   <xsl:template name="relatedContentButton">
  90.     <!-- no related content button -->
  91.   </xsl:template>
  92.   
  93.   <xsl:template name="relatedContentMenu">
  94.     <!-- no related content menu -->
  95.   </xsl:template>
  96.  
  97. </xsl:stylesheet>  
  98.