home *** CD-ROM | disk | FTP | other *** search
/ Organic Chemistry (8th Edition) / Image.iso / pc / organic / media / content / book_flash.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-05-08  |  3.0 KB  |  103 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <!-- Edugen XSL Stylesheets V1.0 =======================================
  5.  
  6.      File book_flash.xsl for Organic View
  7.  
  8.      This file is part of the Edugen XSL Stylesheets.
  9.      Copyright (c) 2002 WWL Corp. - A Subsidiary of John Wiley & Sons, Inc.
  10. ========================================================================= -->
  11. <xsl:output method="xml" indent="yes"/>
  12.  
  13.  
  14. <xsl:template match="/">
  15. <book id="{project/@id}">
  16. <xsl:for-each select="project/chapter">
  17.     <xsl:variable name="m_file"><xsl:value-of select="@href"/></xsl:variable>
  18.     <xsl:apply-templates select="document($m_file)/chapter"/>
  19. </xsl:for-each>
  20. </book>
  21. </xsl:template>
  22.  
  23. <xsl:template match="chapter">
  24.     <chapter>
  25.         <xsl:if test="@id">
  26.             <xsl:copy-of select="@id"/>
  27.         </xsl:if>
  28.         <xsl:apply-templates select="title"/>
  29.         <xsl:apply-templates select="section"/>
  30.     </chapter>
  31. </xsl:template>
  32.  
  33. <xsl:template match="chapter/title">
  34.     <title>Chapter <xsl:value-of select="../@num"/>: <xsl:apply-templates/></title>
  35. </xsl:template>
  36.  
  37. <xsl:template match="section/title">
  38.     <title><xsl:value-of select="../@num"/>: <xsl:apply-templates/></title>
  39. </xsl:template>
  40.  
  41. <xsl:template match="item/title">
  42.     <title><xsl:apply-templates/> (<xsl:value-of select="../@type"/>)</title>
  43. </xsl:template>
  44.  
  45. <xsl:template match="section">
  46. <xsl:choose>
  47.     <xsl:when test="child::item">
  48.         <section>
  49.             <xsl:if test="@id">
  50.                 <xsl:copy-of select="@id"/>
  51.             </xsl:if>
  52.             <xsl:apply-templates select="title"/>
  53.             <xsl:apply-templates select="item"/>
  54.         </section>
  55.     </xsl:when>
  56.     <xsl:otherwise></xsl:otherwise>
  57. </xsl:choose>
  58.  
  59. </xsl:template>
  60.  
  61. <xsl:template match="item">
  62.     <item>
  63.         <xsl:if test="@id">
  64.             <xsl:copy-of select="@id"/>
  65.         </xsl:if>
  66.         <xsl:if test="@type">
  67.             <xsl:copy-of select="@type"/>
  68.         </xsl:if>
  69.         <xsl:if test="@page">
  70.             <xsl:copy-of select="@page"/>
  71.         </xsl:if>
  72.         <xsl:apply-templates select="title"/>
  73.         <xsl:apply-templates select="description"/>
  74.     </item>
  75. </xsl:template>
  76.  
  77. <xsl:template match="description">
  78. <description>
  79. <xsl:choose>
  80.     <xsl:when test="following-sibling::pdb">
  81.         <xsl:text>A 3D molecular model in Rasmol format</xsl:text>
  82.     </xsl:when>
  83.     <xsl:when test="following-sibling::c3d">
  84.         <xsl:text>A 3D molecular model in Chem3D format</xsl:text>
  85.     </xsl:when>
  86.     <xsl:when test="parent::item/@type='IE'">
  87.         <xsl:text>Interactive Exercise</xsl:text>
  88.     </xsl:when>
  89.     <xsl:when test="parent::item/@type='DR'">
  90.         <xsl:text>An electronic flashcard screen to practice remembering reaction patterns and reagents.</xsl:text>
  91.     </xsl:when>
  92.     <xsl:when test="parent::item/@type='AG'">
  93.         <xsl:text>A rotating, 3D version  of a text graphic.</xsl:text>
  94.     </xsl:when>
  95.     <xsl:when test="parent::item/@type='CU'">
  96.         <xsl:text>A graphics/audio presentation on a topic involving complex 3D structure or relationships or a dynamic process.</xsl:text>
  97.     </xsl:when>
  98.     <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
  99. </xsl:choose>
  100. </description>
  101. </xsl:template>
  102.  
  103. </xsl:stylesheet>