manual.xsl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4. version="1.0">
  5. <xsl:import href="@DOCBOOK_XSL_PATH@/fo/docbook.xsl"/>
  6. <xsl:param name="fop1.extensions" select="1"/>
  7. <xsl:param name="title.margin.left" select="'0pt'"/>
  8. <xsl:param name="body.start.indent" select="'0pt'"/>
  9. <xsl:param name="variablelist.as.blocks" select="1"/>
  10. <xsl:param name="paper.type" select="'A4'"/>
  11. <xsl:template match="processing-instruction('hard-pagebreak')">
  12. <fo:block break-before='page'/>
  13. </xsl:template>
  14. <xsl:template match="appendix[@id='ap_glossary']/variablelist"
  15. mode="fop1.outline">
  16. <xsl:variable name="id">
  17. <xsl:call-template name="object.id"/>
  18. </xsl:variable>
  19. <xsl:variable name="bookmark-label">
  20. <xsl:apply-templates select="." mode="object.title.markup"/>
  21. </xsl:variable>
  22. <!-- Put the root element bookmark at the same level as its children -->
  23. <!-- If the object is a set or book, generate a bookmark for the toc -->
  24. <xsl:choose>
  25. <xsl:when test="parent::*">
  26. <fo:bookmark internal-destination="{$id}">
  27. <fo:bookmark-title>
  28. <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
  29. </fo:bookmark-title>
  30. <xsl:apply-templates select="*" mode="fop1.outline"/>
  31. </fo:bookmark>
  32. </xsl:when>
  33. <xsl:otherwise>
  34. <fo:bookmark internal-destination="{$id}">
  35. <fo:bookmark-title>
  36. <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
  37. </fo:bookmark-title>
  38. </fo:bookmark>
  39. <xsl:variable name="toc.params">
  40. <xsl:call-template name="find.path.params">
  41. <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
  42. </xsl:call-template>
  43. </xsl:variable>
  44. <xsl:if test="contains($toc.params, 'toc')
  45. and (book|part|reference|preface|chapter|appendix|article
  46. |glossary|bibliography|index|setindex
  47. |refentry
  48. |sect1|sect2|sect3|sect4|sect5|section)">
  49. <fo:bookmark internal-destination="toc...{$id}">
  50. <fo:bookmark-title>
  51. <xsl:call-template name="gentext">
  52. <xsl:with-param name="key" select="'TableofContents'"/>
  53. </xsl:call-template>
  54. </fo:bookmark-title>
  55. </fo:bookmark>
  56. </xsl:if>
  57. <xsl:apply-templates select="*" mode="fop1.outline"/>
  58. </xsl:otherwise>
  59. </xsl:choose>
  60. </xsl:template>
  61. </xsl:stylesheet>