home *** CD-ROM | disk | FTP | other *** search
/ Organic Chemistry (8th Edition) / Image.iso / pc / organic / media / content / page.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-04-18  |  2.6 KB  |  107 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 page.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. <xsl:param name="id"></xsl:param>
  14.  
  15. <xsl:template match="/">
  16.     <xsl:apply-templates select="//*[@id=$id]"/>
  17. </xsl:template>
  18.  
  19.  
  20. <xsl:template match="chapter">
  21.     <xsl:apply-templates select="section"/>
  22. </xsl:template>
  23.  
  24. <xsl:template match="section|item">
  25.     <xsl:variable name="chapter_id"><xsl:value-of select="../../@id"/></xsl:variable>
  26.     <xsl:variable name="section_num"><xsl:value-of select="../@num"/></xsl:variable>
  27.     <xsl:variable name="item_id"><xsl:value-of select="@id"/></xsl:variable>
  28.  
  29. <page id="{$item_id}" xmlns:xlink="http://www.w3.org/1999/xlink" xml:base="media/content/{$chapter_id}/">
  30.     <head num="{$section_num}">
  31.     <xsl:apply-templates select="../title"/>
  32. </head>
  33. <title>
  34.     <xsl:apply-templates select="title"/>
  35. </title>
  36.  
  37. <content>
  38. <section>
  39.     <xsl:apply-templates select="director|pdb|c3d|qtmovie"/>
  40. </section>
  41. </content>
  42.  
  43. </page>
  44.  
  45. </xsl:template>
  46.  
  47.  
  48. <xsl:template match="section/title">
  49.     <xsl:apply-templates/>
  50. </xsl:template>
  51.  
  52. <xsl:template match="item/title">
  53.     <xsl:apply-templates/>
  54. </xsl:template>
  55.  
  56. <xsl:template match="director">
  57. <xsl:choose>
  58.     <xsl:when test="@src != ''">
  59.         <director src="{@src}" width="640" height="480" border="0" id="{@id}">
  60.             <xsl:apply-templates select="param"/>
  61.         </director>
  62.     </xsl:when>
  63.     <xsl:otherwise>
  64.         <para>This resource is not implemented.</para>
  65.     </xsl:otherwise>
  66. </xsl:choose>
  67. </xsl:template>
  68.  
  69. <xsl:template match="param">
  70.     <xsl:copy-of select="."/>
  71. </xsl:template>
  72.  
  73. <xsl:template match="pdb">
  74. <xsl:choose>
  75.     <xsl:when test="@src != ''">
  76.         <pdb src="{@src}"/>
  77.     </xsl:when>
  78.     <xsl:otherwise>
  79.         <para>This resource is not implemented.</para>
  80.     </xsl:otherwise>
  81. </xsl:choose>
  82. </xsl:template>
  83.  
  84. <xsl:template match="c3d">
  85.  
  86. <xsl:choose>
  87.     <xsl:when test="@src != ''">
  88.         <c3d src="{@src}"/>
  89.     </xsl:when>
  90.     <xsl:otherwise>
  91.         <para>This resource is not implemented.</para>
  92.     </xsl:otherwise>
  93. </xsl:choose>
  94. </xsl:template>
  95.  
  96. <xsl:template match="qtmovie">
  97. <xsl:choose>
  98.     <xsl:when test="@src != ''">
  99.         <xsl:copy-of select="."/>
  100.     </xsl:when>
  101.     <xsl:otherwise>
  102.         <para>This resource is not implemented.</para>
  103.     </xsl:otherwise>
  104. </xsl:choose>
  105. </xsl:template>
  106.  
  107. </xsl:stylesheet>