layout-masters-attr.xsl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. Copyright 2011 Jarno Elovirta
  5. See the accompanying LICENSE file for applicable license.
  6. -->
  7. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  9. version="2.0">
  10. <xsl:attribute-set name="simple-page-master">
  11. <xsl:attribute name="page-width">
  12. <xsl:value-of select="$page-width"/>
  13. </xsl:attribute>
  14. <xsl:attribute name="page-height">
  15. <xsl:value-of select="$page-height"/>
  16. </xsl:attribute>
  17. </xsl:attribute-set>
  18. <!-- legacy attribute set -->
  19. <xsl:attribute-set name="region-body" use-attribute-sets="region-body.odd"/>
  20. <xsl:attribute-set name="region-body.odd">
  21. <xsl:attribute name="margin-top">
  22. <xsl:value-of select="$page-margin-top"/>
  23. </xsl:attribute>
  24. <xsl:attribute name="margin-bottom">
  25. <xsl:value-of select="$page-margin-bottom"/>
  26. </xsl:attribute>
  27. <xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-left' else 'margin-right'}">
  28. <xsl:value-of select="$page-margin-inside"/>
  29. </xsl:attribute>
  30. <xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-right' else 'margin-left'}">
  31. <xsl:value-of select="$page-margin-outside"/>
  32. </xsl:attribute>
  33. </xsl:attribute-set>
  34. <xsl:attribute-set name="region-body.even">
  35. <xsl:attribute name="margin-top">
  36. <xsl:value-of select="$page-margin-top"/>
  37. </xsl:attribute>
  38. <xsl:attribute name="margin-bottom">
  39. <xsl:value-of select="$page-margin-bottom"/>
  40. </xsl:attribute>
  41. <xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-left' else 'margin-right'}">
  42. <xsl:value-of select="$page-margin-outside"/>
  43. </xsl:attribute>
  44. <xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-right' else 'margin-left'}">
  45. <xsl:value-of select="$page-margin-inside"/>
  46. </xsl:attribute>
  47. </xsl:attribute-set>
  48. <xsl:attribute-set name="region-body__frontmatter.odd" use-attribute-sets="region-body.odd">
  49. </xsl:attribute-set>
  50. <xsl:attribute-set name="region-body__frontmatter.even" use-attribute-sets="region-body.even">
  51. </xsl:attribute-set>
  52. <xsl:attribute-set name="region-body__backcover.odd" use-attribute-sets="region-body.odd">
  53. </xsl:attribute-set>
  54. <xsl:attribute-set name="region-body__backcover.even" use-attribute-sets="region-body.even">
  55. </xsl:attribute-set>
  56. <!-- legacy attribute set -->
  57. <xsl:attribute-set name="region-body__index" use-attribute-sets="region-body__index.odd"/>
  58. <xsl:attribute-set name="region-body__index.odd" use-attribute-sets="region-body.odd">
  59. <xsl:attribute name="column-count">2</xsl:attribute>
  60. </xsl:attribute-set>
  61. <xsl:attribute-set name="region-body__index.even" use-attribute-sets="region-body.even">
  62. <xsl:attribute name="column-count">2</xsl:attribute>
  63. </xsl:attribute-set>
  64. <xsl:attribute-set name="region-before">
  65. <xsl:attribute name="extent">
  66. <xsl:value-of select="$page-margin-top"/>
  67. </xsl:attribute>
  68. <xsl:attribute name="display-align">before</xsl:attribute>
  69. </xsl:attribute-set>
  70. <xsl:attribute-set name="region-after">
  71. <xsl:attribute name="extent">
  72. <xsl:value-of select="$page-margin-bottom"/>
  73. </xsl:attribute>
  74. <xsl:attribute name="display-align">after</xsl:attribute>
  75. </xsl:attribute-set>
  76. </xsl:stylesheet>