layout-masters-attr.xsl 3.3 KB

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