slidy.xsl 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="ASCII"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns="http://www.w3.org/1999/xhtml"
  4. xmlns:db="http://docbook.org/ns/docbook"
  5. xmlns:dbs="http://docbook.org/ns/docbook-slides"
  6. exclude-result-prefixes="dbs db"
  7. version="1.0">
  8. <xsl:import href="plain.xsl"/>
  9. <xsl:param name="wrap.slidecontent">0</xsl:param>
  10. <xsl:template name="xhtml.head">
  11. <meta name="copyright">
  12. <xsl:attribute name="content">
  13. <xsl:if test="/dbs:slides/db:info/db:copyright">
  14. <xsl:call-template name="slide.copyright"/>
  15. </xsl:if>
  16. </xsl:attribute>
  17. </meta>
  18. <xsl:if test="$slidy.duration != 0">
  19. <meta name="duration" content="{$slidy.duration}"/>
  20. </xsl:if>
  21. <link rel="stylesheet" href="{concat($slidy.path.prefix, $slidy.slidy.css)}" type="text/css"/>
  22. <xsl:if test="$slidy.user.css">
  23. <link rel="stylesheet" href="{concat($slidy.path.prefix, $slidy.user.css)}" type="text/css"/>
  24. </xsl:if>
  25. <link rel="stylesheet" href="{$user.css}" type="text/css"/>
  26. <script src="{concat($slidy.path.prefix, $slidy.slidy.js)}" charset="utf-8" type="text/javascript"/>
  27. </xsl:template>
  28. <xsl:template name="slideshow.head">
  29. <div class="background"/>
  30. </xsl:template>
  31. <xsl:template name="slideshow.content">
  32. <xsl:if test="$generate.titlepage != 0">
  33. <xsl:apply-templates select="/dbs:slides" mode="titlepage"/>
  34. </xsl:if>
  35. <xsl:apply-templates select="/dbs:slides/dbs:foil|dbs:slides/dbs:foilgroup"/>
  36. </xsl:template>
  37. <xsl:template match="db:xref">
  38. <xsl:variable name="target" select="id(./@linkend)"/>
  39. <xsl:choose>
  40. <xsl:when test="($target[self::dbs:foil] or $target[self::dbs:foilgroup])">
  41. <!-- foil no: preceding foil(group)s + titlepage + 1 -->
  42. <xsl:variable name="target.no" select="count($target/preceding::dbs:foil|$target/preceding::dbs:foilgroup) + 1 + $generate.titlepage"/>
  43. <a href="{concat('#(', $target.no, ')')}">
  44. <xsl:apply-templates select="$target" mode="xref-to"/>
  45. </a>
  46. </xsl:when>
  47. <xsl:otherwise>
  48. <xsl:call-template name="xref"/>
  49. </xsl:otherwise>
  50. </xsl:choose>
  51. </xsl:template>
  52. <xsl:template match="db:biblioentry" mode="xref-to">
  53. <xsl:variable name="id" select="@xml:id"/>
  54. <xsl:variable name="entry" select="//db:bibliography/*[@xml:id=$id][1]"/>
  55. <a>
  56. <xsl:attribute name="href">
  57. <xsl:value-of select="concat('#(', count($entry/preceding::dbs:foil|$entry/preceding::dbs:foilgroup) + 1 + $generate.titlepage, ')')"/>
  58. </xsl:attribute>
  59. <xsl:choose>
  60. <xsl:when test="$bibliography.numbered != 0">
  61. <xsl:number from="db:bibliography" count="db:biblioentry|db:bibliomixed" level="any" format="1"/>
  62. </xsl:when>
  63. <xsl:otherwise>
  64. <xsl:value-of select="$id"/>
  65. </xsl:otherwise>
  66. </xsl:choose>
  67. </a>
  68. </xsl:template>
  69. </xsl:stylesheet>