Ignore:
Timestamp:
12/10/2013 11:37:38 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
112db9d
Parents:
f2a5108
Message:

Import new branch

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10389 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/fo/pagesetup.xsl

    rf2a5108 rb1a51ac1  
    55
    66<!-- ********************************************************************
    7      $Id$
     7     $Id: pagesetup.xsl 9720 2013-01-31 18:24:47Z bobstayton $
    88     ********************************************************************
    99
     
    2020  <xsl:if test="$body.font.family != ''
    2121                and $symbol.font.family  != ''">,</xsl:if>
    22     <xsl:value-of select="$symbol.font.family"/>
     22  <xsl:value-of select="$symbol.font.family"/>
    2323</xsl:param>
    2424
     
    2727  <xsl:if test="$title.font.family != ''
    2828                and $symbol.font.family  != ''">,</xsl:if>
    29     <xsl:value-of select="$symbol.font.family"/>
     29  <xsl:value-of select="$symbol.font.family"/>
    3030</xsl:param>
    3131
    32 <!-- PassiveTeX can't handle the math expression for
    33      title.margin.left being negative, so ignore it.
    34      margin-left="{$page.margin.outer} - {$title.margin.left}"
    35 -->
    36 <xsl:param name="margin.left.outer">
     32<xsl:param name="dingbat.fontset">
     33  <xsl:value-of select="$dingbat.font.family"/>
     34  <xsl:if test="$dingbat.font.family != ''
     35                and $symbol.font.family  != ''">,</xsl:if>
     36  <xsl:value-of select="$symbol.font.family"/>
     37</xsl:param>
     38
     39<!-- These are internal parameters are for the individual precedence attributes -->
     40<xsl:param name="region.start.precedence">
    3741  <xsl:choose>
    38     <xsl:when test="$passivetex.extensions != 0">
    39       <xsl:value-of select="$page.margin.outer"/>
    40     </xsl:when>
    41     <xsl:otherwise>
    42       <xsl:value-of select="$page.margin.outer"/>
    43       <xsl:text> - </xsl:text>
    44       <xsl:value-of select="$title.margin.left"/>
    45     </xsl:otherwise>
     42    <xsl:when test="$side.region.precedence = 'true'">true</xsl:when>
     43    <xsl:otherwise>false</xsl:otherwise>
    4644  </xsl:choose>
    4745</xsl:param>
    4846
    49 <xsl:param name="margin.left.inner">
     47<xsl:param name="region.end.precedence">
    5048  <xsl:choose>
    51     <xsl:when test="$passivetex.extensions != 0">
    52       <xsl:value-of select="$page.margin.inner"/>
    53     </xsl:when>
    54     <xsl:otherwise>
    55       <xsl:value-of select="$page.margin.inner"/>
    56       <xsl:text> - </xsl:text>
    57       <xsl:value-of select="$title.margin.left"/>
    58     </xsl:otherwise>
     49    <xsl:when test="$side.region.precedence = 'true'">true</xsl:when>
     50    <xsl:otherwise>false</xsl:otherwise>
     51  </xsl:choose>
     52</xsl:param>
     53
     54<xsl:param name="region.before.precedence">
     55  <xsl:choose>
     56    <xsl:when test="$side.region.precedence = 'true'">false</xsl:when>
     57    <xsl:otherwise>true</xsl:otherwise>
     58  </xsl:choose>
     59</xsl:param>
     60
     61<xsl:param name="region.after.precedence">
     62  <xsl:choose>
     63    <xsl:when test="$side.region.precedence = 'true'">false</xsl:when>
     64    <xsl:otherwise>true</xsl:otherwise>
    5965  </xsl:choose>
    6066</xsl:param>
     
    6773                           page-height="{$page.height}"
    6874                           margin-top="{$page.margin.top}"
    69                            margin-bottom="{$page.margin.bottom}"
    70                            margin-left="{$margin.left.outer}"
    71                            margin-right="{$page.margin.inner}">
     75                           margin-bottom="{$page.margin.bottom}">
     76      <xsl:attribute name="margin-{$direction.align.start}">
     77        <xsl:value-of select="$page.margin.outer"/>
     78        <xsl:if test="$fop.extensions != 0">
     79          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     80        </xsl:if>
     81      </xsl:attribute>
     82      <xsl:attribute name="margin-{$direction.align.end}">
     83        <xsl:value-of select="$page.margin.inner"/>
     84      </xsl:attribute>
    7285      <xsl:if test="$axf.extensions != 0">
    7386        <xsl:call-template name="axf-page-master-properties">
     
    7891                      margin-bottom="{$body.margin.bottom}"
    7992                      margin-top="{$body.margin.top}">
     93        <xsl:attribute name="margin-{$direction.align.start}">
     94          <xsl:value-of select="$body.margin.outer"/>
     95        </xsl:attribute>
     96        <xsl:attribute name="margin-{$direction.align.end}">
     97          <xsl:value-of select="$body.margin.inner"/>
     98        </xsl:attribute>
    8099        <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
    81100          <xsl:attribute name="region-name">blank-body</xsl:attribute>
     
    84103      <fo:region-before region-name="xsl-region-before-blank"
    85104                        extent="{$region.before.extent}"
     105                        precedence="{$region.before.precedence}"
    86106                        display-align="before"/>
    87107      <fo:region-after region-name="xsl-region-after-blank"
    88108                       extent="{$region.after.extent}"
    89                         display-align="after"/>
     109                       precedence="{$region.after.precedence}"
     110                       display-align="after"/>
     111      <xsl:call-template name="region.outer">
     112        <xsl:with-param name="sequence">blank</xsl:with-param>
     113        <xsl:with-param name="pageclass">blank</xsl:with-param>
     114      </xsl:call-template>
     115      <xsl:call-template name="region.inner">
     116        <xsl:with-param name="sequence">blank</xsl:with-param>
     117        <xsl:with-param name="pageclass">blank</xsl:with-param>
     118      </xsl:call-template>
    90119    </fo:simple-page-master>
    91120
     
    95124                           page-height="{$page.height}"
    96125                           margin-top="{$page.margin.top}"
    97                            margin-bottom="{$page.margin.bottom}"
    98                            margin-left="{$margin.left.inner}"
    99                            margin-right="{$page.margin.outer}">
     126                           margin-bottom="{$page.margin.bottom}">
     127      <xsl:attribute name="margin-{$direction.align.start}">
     128        <xsl:value-of select="$page.margin.inner"/>
     129        <xsl:if test="$fop.extensions != 0">
     130          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     131        </xsl:if>
     132      </xsl:attribute>
     133      <xsl:attribute name="margin-{$direction.align.end}">
     134        <xsl:value-of select="$page.margin.outer"/>
     135      </xsl:attribute>
    100136      <xsl:if test="$axf.extensions != 0">
    101137        <xsl:call-template name="axf-page-master-properties">
     
    107143                      column-gap="{$column.gap.titlepage}"
    108144                      column-count="{$column.count.titlepage}">
     145        <xsl:attribute name="margin-{$direction.align.start}">
     146          <xsl:value-of select="$body.margin.inner"/>
     147        </xsl:attribute>
     148        <xsl:attribute name="margin-{$direction.align.end}">
     149          <xsl:value-of select="$body.margin.outer"/>
     150        </xsl:attribute>
    109151      </fo:region-body>
    110152      <fo:region-before region-name="xsl-region-before-first"
    111153                        extent="{$region.before.extent}"
     154                        precedence="{$region.before.precedence}"
    112155                        display-align="before"/>
    113156      <fo:region-after region-name="xsl-region-after-first"
    114157                       extent="{$region.after.extent}"
     158                        precedence="{$region.after.precedence}"
    115159                        display-align="after"/>
     160      <xsl:call-template name="region.inner">
     161        <xsl:with-param name="sequence">first</xsl:with-param>
     162        <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     163      </xsl:call-template>
     164      <xsl:call-template name="region.outer">
     165        <xsl:with-param name="sequence">first</xsl:with-param>
     166        <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     167      </xsl:call-template>
    116168    </fo:simple-page-master>
    117169
     
    120172                           page-height="{$page.height}"
    121173                           margin-top="{$page.margin.top}"
    122                            margin-bottom="{$page.margin.bottom}"
    123                            margin-left="{$margin.left.inner}"
    124                            margin-right="{$page.margin.outer}">
     174                           margin-bottom="{$page.margin.bottom}">
     175      <xsl:attribute name="margin-{$direction.align.start}">
     176        <xsl:value-of select="$page.margin.inner"/>
     177        <xsl:if test="$fop.extensions != 0">
     178          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     179        </xsl:if>
     180      </xsl:attribute>
     181      <xsl:attribute name="margin-{$direction.align.end}">
     182        <xsl:value-of select="$page.margin.outer"/>
     183      </xsl:attribute>
    125184      <xsl:if test="$axf.extensions != 0">
    126185        <xsl:call-template name="axf-page-master-properties">
     
    132191                      column-gap="{$column.gap.titlepage}"
    133192                      column-count="{$column.count.titlepage}">
     193        <xsl:attribute name="margin-{$direction.align.start}">
     194          <xsl:value-of select="$body.margin.inner"/>
     195        </xsl:attribute>
     196        <xsl:attribute name="margin-{$direction.align.end}">
     197          <xsl:value-of select="$body.margin.outer"/>
     198        </xsl:attribute>
    134199      </fo:region-body>
    135200      <fo:region-before region-name="xsl-region-before-odd"
    136201                        extent="{$region.before.extent}"
     202                        precedence="{$region.before.precedence}"
    137203                        display-align="before"/>
    138204      <fo:region-after region-name="xsl-region-after-odd"
    139205                       extent="{$region.after.extent}"
     206                        precedence="{$region.after.precedence}"
    140207                        display-align="after"/>
     208      <xsl:call-template name="region.inner">
     209        <xsl:with-param name="sequence">odd</xsl:with-param>
     210        <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     211      </xsl:call-template>
     212      <xsl:call-template name="region.outer">
     213        <xsl:with-param name="sequence">odd</xsl:with-param>
     214        <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     215      </xsl:call-template>
    141216    </fo:simple-page-master>
    142217
     
    145220                           page-height="{$page.height}"
    146221                           margin-top="{$page.margin.top}"
    147                            margin-bottom="{$page.margin.bottom}"
    148                            margin-left="{$margin.left.outer}"
    149                            margin-right="{$page.margin.inner}">
     222                           margin-bottom="{$page.margin.bottom}">
     223      <xsl:attribute name="margin-{$direction.align.start}">
     224        <xsl:value-of select="$page.margin.outer"/>
     225        <xsl:if test="$fop.extensions != 0">
     226          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     227        </xsl:if>
     228      </xsl:attribute>
     229      <xsl:attribute name="margin-{$direction.align.end}">
     230        <xsl:value-of select="$page.margin.inner"/>
     231      </xsl:attribute>
    150232      <xsl:if test="$axf.extensions != 0">
    151233        <xsl:call-template name="axf-page-master-properties">
     
    157239                      column-gap="{$column.gap.titlepage}"
    158240                      column-count="{$column.count.titlepage}">
     241        <xsl:attribute name="margin-{$direction.align.start}">
     242          <xsl:value-of select="$body.margin.outer"/>
     243        </xsl:attribute>
     244        <xsl:attribute name="margin-{$direction.align.end}">
     245          <xsl:value-of select="$body.margin.inner"/>
     246        </xsl:attribute>
    159247      </fo:region-body>
    160248      <fo:region-before region-name="xsl-region-before-even"
    161249                        extent="{$region.before.extent}"
     250                        precedence="{$region.before.precedence}"
    162251                        display-align="before"/>
    163252      <fo:region-after region-name="xsl-region-after-even"
    164253                       extent="{$region.after.extent}"
     254                        precedence="{$region.after.precedence}"
    165255                        display-align="after"/>
     256      <xsl:call-template name="region.outer">
     257        <xsl:with-param name="sequence">even</xsl:with-param>
     258        <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     259      </xsl:call-template>
     260      <xsl:call-template name="region.inner">
     261        <xsl:with-param name="sequence">even</xsl:with-param>
     262        <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     263      </xsl:call-template>
    166264    </fo:simple-page-master>
    167265
     
    171269                           page-height="{$page.height}"
    172270                           margin-top="{$page.margin.top}"
    173                            margin-bottom="{$page.margin.bottom}"
    174                            margin-left="{$margin.left.inner}"
    175                            margin-right="{$page.margin.outer}">
     271                           margin-bottom="{$page.margin.bottom}">
     272      <xsl:attribute name="margin-{$direction.align.start}">
     273        <xsl:value-of select="$page.margin.inner"/>
     274        <xsl:if test="$fop.extensions != 0">
     275          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     276        </xsl:if>
     277      </xsl:attribute>
     278      <xsl:attribute name="margin-{$direction.align.end}">
     279        <xsl:value-of select="$page.margin.outer"/>
     280      </xsl:attribute>
    176281      <xsl:if test="$axf.extensions != 0">
    177282        <xsl:call-template name="axf-page-master-properties">
     
    183288                      column-gap="{$column.gap.lot}"
    184289                      column-count="{$column.count.lot}">
     290        <xsl:attribute name="margin-{$direction.align.start}">
     291          <xsl:value-of select="$body.margin.inner"/>
     292        </xsl:attribute>
     293        <xsl:attribute name="margin-{$direction.align.end}">
     294          <xsl:value-of select="$body.margin.outer"/>
     295        </xsl:attribute>
    185296      </fo:region-body>
    186297      <fo:region-before region-name="xsl-region-before-first"
    187298                        extent="{$region.before.extent}"
     299                        precedence="{$region.before.precedence}"
    188300                        display-align="before"/>
    189301      <fo:region-after region-name="xsl-region-after-first"
    190302                       extent="{$region.after.extent}"
     303                        precedence="{$region.after.precedence}"
    191304                       display-align="after"/>
     305      <xsl:call-template name="region.inner">
     306        <xsl:with-param name="sequence">first</xsl:with-param>
     307        <xsl:with-param name="pageclass">lot</xsl:with-param>
     308      </xsl:call-template>
     309      <xsl:call-template name="region.outer">
     310        <xsl:with-param name="sequence">first</xsl:with-param>
     311        <xsl:with-param name="pageclass">lot</xsl:with-param>
     312      </xsl:call-template>
    192313    </fo:simple-page-master>
    193314
     
    196317                           page-height="{$page.height}"
    197318                           margin-top="{$page.margin.top}"
    198                            margin-bottom="{$page.margin.bottom}"
    199                            margin-left="{$margin.left.inner}"
    200                            margin-right="{$page.margin.outer}">
     319                           margin-bottom="{$page.margin.bottom}">
     320      <xsl:attribute name="margin-{$direction.align.start}">
     321        <xsl:value-of select="$page.margin.inner"/>
     322        <xsl:if test="$fop.extensions != 0">
     323          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     324        </xsl:if>
     325      </xsl:attribute>
     326      <xsl:attribute name="margin-{$direction.align.end}">
     327        <xsl:value-of select="$page.margin.outer"/>
     328      </xsl:attribute>
    201329      <xsl:if test="$axf.extensions != 0">
    202330        <xsl:call-template name="axf-page-master-properties">
     
    208336                      column-gap="{$column.gap.lot}"
    209337                      column-count="{$column.count.lot}">
     338        <xsl:attribute name="margin-{$direction.align.start}">
     339          <xsl:value-of select="$body.margin.inner"/>
     340        </xsl:attribute>
     341        <xsl:attribute name="margin-{$direction.align.end}">
     342          <xsl:value-of select="$body.margin.outer"/>
     343        </xsl:attribute>
    210344      </fo:region-body>
    211345      <fo:region-before region-name="xsl-region-before-odd"
    212346                        extent="{$region.before.extent}"
     347                        precedence="{$region.before.precedence}"
    213348                        display-align="before"/>
    214349      <fo:region-after region-name="xsl-region-after-odd"
    215350                       extent="{$region.after.extent}"
     351                        precedence="{$region.after.precedence}"
    216352                        display-align="after"/>
     353      <xsl:call-template name="region.inner">
     354        <xsl:with-param name="sequence">odd</xsl:with-param>
     355        <xsl:with-param name="pageclass">lot</xsl:with-param>
     356      </xsl:call-template>
     357      <xsl:call-template name="region.outer">
     358        <xsl:with-param name="sequence">odd</xsl:with-param>
     359        <xsl:with-param name="pageclass">lot</xsl:with-param>
     360      </xsl:call-template>
    217361    </fo:simple-page-master>
    218362
     
    221365                           page-height="{$page.height}"
    222366                           margin-top="{$page.margin.top}"
    223                            margin-bottom="{$page.margin.bottom}"
    224                            margin-left="{$margin.left.outer}"
    225                            margin-right="{$page.margin.inner}">
     367                           margin-bottom="{$page.margin.bottom}">
     368      <xsl:attribute name="margin-{$direction.align.start}">
     369        <xsl:value-of select="$page.margin.outer"/>
     370        <xsl:if test="$fop.extensions != 0">
     371          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     372        </xsl:if>
     373      </xsl:attribute>
     374      <xsl:attribute name="margin-{$direction.align.end}">
     375        <xsl:value-of select="$page.margin.inner"/>
     376      </xsl:attribute>
    226377      <xsl:if test="$axf.extensions != 0">
    227378        <xsl:call-template name="axf-page-master-properties">
     
    233384                      column-gap="{$column.gap.lot}"
    234385                      column-count="{$column.count.lot}">
     386        <xsl:attribute name="margin-{$direction.align.start}">
     387          <xsl:value-of select="$body.margin.outer"/>
     388        </xsl:attribute>
     389        <xsl:attribute name="margin-{$direction.align.end}">
     390          <xsl:value-of select="$body.margin.inner"/>
     391        </xsl:attribute>
    235392      </fo:region-body>
    236393      <fo:region-before region-name="xsl-region-before-even"
    237394                        extent="{$region.before.extent}"
     395                        precedence="{$region.before.precedence}"
    238396                        display-align="before"/>
    239397      <fo:region-after region-name="xsl-region-after-even"
    240398                       extent="{$region.after.extent}"
     399                        precedence="{$region.after.precedence}"
    241400                        display-align="after"/>
     401      <xsl:call-template name="region.outer">
     402        <xsl:with-param name="sequence">even</xsl:with-param>
     403        <xsl:with-param name="pageclass">lot</xsl:with-param>
     404      </xsl:call-template>
     405      <xsl:call-template name="region.inner">
     406        <xsl:with-param name="sequence">even</xsl:with-param>
     407        <xsl:with-param name="pageclass">lot</xsl:with-param>
     408      </xsl:call-template>
    242409    </fo:simple-page-master>
    243410
     
    247414                           page-height="{$page.height}"
    248415                           margin-top="{$page.margin.top}"
    249                            margin-bottom="{$page.margin.bottom}"
    250                            margin-left="{$margin.left.inner}"
    251                            margin-right="{$page.margin.outer}">
     416                           margin-bottom="{$page.margin.bottom}">
     417      <xsl:attribute name="margin-{$direction.align.start}">
     418        <xsl:value-of select="$page.margin.inner"/>
     419        <xsl:if test="$fop.extensions != 0">
     420          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     421        </xsl:if>
     422      </xsl:attribute>
     423      <xsl:attribute name="margin-{$direction.align.end}">
     424        <xsl:value-of select="$page.margin.outer"/>
     425      </xsl:attribute>
    252426      <xsl:if test="$axf.extensions != 0">
    253427        <xsl:call-template name="axf-page-master-properties">
     
    259433                      column-gap="{$column.gap.front}"
    260434                      column-count="{$column.count.front}">
     435        <xsl:attribute name="margin-{$direction.align.start}">
     436          <xsl:value-of select="$body.margin.inner"/>
     437        </xsl:attribute>
     438        <xsl:attribute name="margin-{$direction.align.end}">
     439          <xsl:value-of select="$body.margin.outer"/>
     440        </xsl:attribute>
    261441      </fo:region-body>
    262442      <fo:region-before region-name="xsl-region-before-first"
    263443                        extent="{$region.before.extent}"
     444                        precedence="{$region.before.precedence}"
    264445                        display-align="before"/>
    265446      <fo:region-after region-name="xsl-region-after-first"
    266447                       extent="{$region.after.extent}"
     448                        precedence="{$region.after.precedence}"
    267449                        display-align="after"/>
     450      <xsl:call-template name="region.inner">
     451        <xsl:with-param name="sequence">first</xsl:with-param>
     452        <xsl:with-param name="pageclass">front</xsl:with-param>
     453      </xsl:call-template>
     454      <xsl:call-template name="region.outer">
     455        <xsl:with-param name="sequence">first</xsl:with-param>
     456        <xsl:with-param name="pageclass">front</xsl:with-param>
     457      </xsl:call-template>
    268458    </fo:simple-page-master>
    269459
     
    272462                           page-height="{$page.height}"
    273463                           margin-top="{$page.margin.top}"
    274                            margin-bottom="{$page.margin.bottom}"
    275                            margin-left="{$margin.left.inner}"
    276                            margin-right="{$page.margin.outer}">
     464                           margin-bottom="{$page.margin.bottom}">
     465      <xsl:attribute name="margin-{$direction.align.start}">
     466        <xsl:value-of select="$page.margin.inner"/>
     467        <xsl:if test="$fop.extensions != 0">
     468          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     469        </xsl:if>
     470      </xsl:attribute>
     471      <xsl:attribute name="margin-{$direction.align.end}">
     472        <xsl:value-of select="$page.margin.outer"/>
     473      </xsl:attribute>
    277474      <xsl:if test="$axf.extensions != 0">
    278475        <xsl:call-template name="axf-page-master-properties">
     
    284481                      column-gap="{$column.gap.front}"
    285482                      column-count="{$column.count.front}">
     483        <xsl:attribute name="margin-{$direction.align.start}">
     484          <xsl:value-of select="$body.margin.inner"/>
     485        </xsl:attribute>
     486        <xsl:attribute name="margin-{$direction.align.end}">
     487          <xsl:value-of select="$body.margin.outer"/>
     488        </xsl:attribute>
    286489      </fo:region-body>
    287490      <fo:region-before region-name="xsl-region-before-odd"
    288491                        extent="{$region.before.extent}"
     492                        precedence="{$region.before.precedence}"
    289493                        display-align="before"/>
    290494      <fo:region-after region-name="xsl-region-after-odd"
    291495                       extent="{$region.after.extent}"
     496                        precedence="{$region.after.precedence}"
    292497                        display-align="after"/>
     498      <xsl:call-template name="region.inner">
     499        <xsl:with-param name="sequence">odd</xsl:with-param>
     500        <xsl:with-param name="pageclass">front</xsl:with-param>
     501      </xsl:call-template>
     502      <xsl:call-template name="region.outer">
     503        <xsl:with-param name="sequence">odd</xsl:with-param>
     504        <xsl:with-param name="pageclass">front</xsl:with-param>
     505      </xsl:call-template>
    293506    </fo:simple-page-master>
    294507
     
    297510                           page-height="{$page.height}"
    298511                           margin-top="{$page.margin.top}"
    299                            margin-bottom="{$page.margin.bottom}"
    300                            margin-left="{$margin.left.outer}"
    301                            margin-right="{$page.margin.inner}">
     512                           margin-bottom="{$page.margin.bottom}">
     513      <xsl:attribute name="margin-{$direction.align.start}">
     514        <xsl:value-of select="$page.margin.outer"/>
     515        <xsl:if test="$fop.extensions != 0">
     516          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     517        </xsl:if>
     518      </xsl:attribute>
     519      <xsl:attribute name="margin-{$direction.align.end}">
     520        <xsl:value-of select="$page.margin.inner"/>
     521      </xsl:attribute>
    302522      <xsl:if test="$axf.extensions != 0">
    303523        <xsl:call-template name="axf-page-master-properties">
     
    309529                      column-gap="{$column.gap.front}"
    310530                      column-count="{$column.count.front}">
     531        <xsl:attribute name="margin-{$direction.align.start}">
     532          <xsl:value-of select="$body.margin.outer"/>
     533        </xsl:attribute>
     534        <xsl:attribute name="margin-{$direction.align.end}">
     535          <xsl:value-of select="$body.margin.inner"/>
     536        </xsl:attribute>
    311537      </fo:region-body>
    312538      <fo:region-before region-name="xsl-region-before-even"
    313539                        extent="{$region.before.extent}"
     540                        precedence="{$region.before.precedence}"
    314541                        display-align="before"/>
    315542      <fo:region-after region-name="xsl-region-after-even"
    316543                       extent="{$region.after.extent}"
     544                        precedence="{$region.after.precedence}"
    317545                        display-align="after"/>
     546      <xsl:call-template name="region.outer">
     547        <xsl:with-param name="sequence">even</xsl:with-param>
     548        <xsl:with-param name="pageclass">front</xsl:with-param>
     549      </xsl:call-template>
     550      <xsl:call-template name="region.inner">
     551        <xsl:with-param name="sequence">even</xsl:with-param>
     552        <xsl:with-param name="pageclass">front</xsl:with-param>
     553      </xsl:call-template>
    318554    </fo:simple-page-master>
    319555
     
    323559                           page-height="{$page.height}"
    324560                           margin-top="{$page.margin.top}"
    325                            margin-bottom="{$page.margin.bottom}"
    326                            margin-left="{$margin.left.inner}"
    327                            margin-right="{$page.margin.outer}">
     561                           margin-bottom="{$page.margin.bottom}">
     562      <xsl:attribute name="margin-{$direction.align.start}">
     563        <xsl:value-of select="$page.margin.inner"/>
     564        <xsl:if test="$fop.extensions != 0">
     565          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     566        </xsl:if>
     567        <xsl:if test="$fop.extensions != 0">
     568          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     569        </xsl:if>
     570      </xsl:attribute>
     571      <xsl:attribute name="margin-{$direction.align.end}">
     572        <xsl:value-of select="$page.margin.outer"/>
     573      </xsl:attribute>
    328574      <xsl:if test="$axf.extensions != 0">
    329575        <xsl:call-template name="axf-page-master-properties">
     
    335581                      column-gap="{$column.gap.body}"
    336582                      column-count="{$column.count.body}">
     583        <xsl:attribute name="margin-{$direction.align.start}">
     584          <xsl:value-of select="$body.margin.inner"/>
     585        </xsl:attribute>
     586        <xsl:attribute name="margin-{$direction.align.end}">
     587          <xsl:value-of select="$body.margin.outer"/>
     588        </xsl:attribute>
    337589      </fo:region-body>
    338590      <fo:region-before region-name="xsl-region-before-first"
    339591                        extent="{$region.before.extent}"
     592                        precedence="{$region.before.precedence}"
    340593                        display-align="before"/>
    341594      <fo:region-after region-name="xsl-region-after-first"
    342595                       extent="{$region.after.extent}"
     596                        precedence="{$region.after.precedence}"
    343597                       display-align="after"/>
     598      <xsl:call-template name="region.inner">
     599        <xsl:with-param name="sequence">first</xsl:with-param>
     600        <xsl:with-param name="pageclass">body</xsl:with-param>
     601      </xsl:call-template>
     602      <xsl:call-template name="region.outer">
     603        <xsl:with-param name="sequence">first</xsl:with-param>
     604        <xsl:with-param name="pageclass">body</xsl:with-param>
     605      </xsl:call-template>
    344606    </fo:simple-page-master>
    345607
     
    348610                           page-height="{$page.height}"
    349611                           margin-top="{$page.margin.top}"
    350                            margin-bottom="{$page.margin.bottom}"
    351                            margin-left="{$margin.left.inner}"
    352                            margin-right="{$page.margin.outer}">
     612                           margin-bottom="{$page.margin.bottom}">
     613      <xsl:attribute name="margin-{$direction.align.start}">
     614        <xsl:value-of select="$page.margin.inner"/>
     615        <xsl:if test="$fop.extensions != 0">
     616          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     617        </xsl:if>
     618      </xsl:attribute>
     619      <xsl:attribute name="margin-{$direction.align.end}">
     620        <xsl:value-of select="$page.margin.outer"/>
     621      </xsl:attribute>
    353622      <xsl:if test="$axf.extensions != 0">
    354623        <xsl:call-template name="axf-page-master-properties">
     
    360629                      column-gap="{$column.gap.body}"
    361630                      column-count="{$column.count.body}">
     631        <xsl:attribute name="margin-{$direction.align.start}">
     632          <xsl:value-of select="$body.margin.inner"/>
     633        </xsl:attribute>
     634        <xsl:attribute name="margin-{$direction.align.end}">
     635          <xsl:value-of select="$body.margin.outer"/>
     636        </xsl:attribute>
    362637      </fo:region-body>
    363638      <fo:region-before region-name="xsl-region-before-odd"
    364639                        extent="{$region.before.extent}"
     640                        precedence="{$region.before.precedence}"
    365641                        display-align="before"/>
    366642      <fo:region-after region-name="xsl-region-after-odd"
    367643                       extent="{$region.after.extent}"
     644                       precedence="{$region.after.precedence}"
    368645                       display-align="after"/>
     646      <xsl:call-template name="region.inner">
     647        <xsl:with-param name="pageclass">body</xsl:with-param>
     648        <xsl:with-param name="sequence">odd</xsl:with-param>
     649      </xsl:call-template>
     650      <xsl:call-template name="region.outer">
     651        <xsl:with-param name="pageclass">body</xsl:with-param>
     652        <xsl:with-param name="sequence">odd</xsl:with-param>
     653      </xsl:call-template>
    369654    </fo:simple-page-master>
    370655
     
    373658                           page-height="{$page.height}"
    374659                           margin-top="{$page.margin.top}"
    375                            margin-bottom="{$page.margin.bottom}"
    376                            margin-left="{$margin.left.outer}"
    377                            margin-right="{$page.margin.inner}">
     660                           margin-bottom="{$page.margin.bottom}">
     661      <xsl:attribute name="margin-{$direction.align.start}">
     662        <xsl:value-of select="$page.margin.outer"/>
     663        <xsl:if test="$fop.extensions != 0">
     664          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     665        </xsl:if>
     666      </xsl:attribute>
     667      <xsl:attribute name="margin-{$direction.align.end}">
     668        <xsl:value-of select="$page.margin.inner"/>
     669      </xsl:attribute>
    378670      <xsl:if test="$axf.extensions != 0">
    379671        <xsl:call-template name="axf-page-master-properties">
     
    385677                      column-gap="{$column.gap.body}"
    386678                      column-count="{$column.count.body}">
     679        <xsl:attribute name="margin-{$direction.align.start}">
     680          <xsl:value-of select="$body.margin.outer"/>
     681        </xsl:attribute>
     682        <xsl:attribute name="margin-{$direction.align.end}">
     683          <xsl:value-of select="$body.margin.inner"/>
     684        </xsl:attribute>
    387685      </fo:region-body>
    388686      <fo:region-before region-name="xsl-region-before-even"
    389687                        extent="{$region.before.extent}"
     688                        precedence="{$region.before.precedence}"
    390689                        display-align="before"/>
    391690      <fo:region-after region-name="xsl-region-after-even"
    392691                       extent="{$region.after.extent}"
     692                       precedence="{$region.after.precedence}"
    393693                       display-align="after"/>
     694      <xsl:call-template name="region.outer">
     695        <xsl:with-param name="pageclass">body</xsl:with-param>
     696        <xsl:with-param name="sequence">even</xsl:with-param>
     697      </xsl:call-template>
     698      <xsl:call-template name="region.inner">
     699        <xsl:with-param name="pageclass">body</xsl:with-param>
     700        <xsl:with-param name="sequence">even</xsl:with-param>
     701      </xsl:call-template>
    394702    </fo:simple-page-master>
    395703
     
    399707                           page-height="{$page.height}"
    400708                           margin-top="{$page.margin.top}"
    401                            margin-bottom="{$page.margin.bottom}"
    402                            margin-left="{$margin.left.inner}"
    403                            margin-right="{$page.margin.outer}">
     709                           margin-bottom="{$page.margin.bottom}">
     710      <xsl:attribute name="margin-{$direction.align.start}">
     711        <xsl:value-of select="$page.margin.inner"/>
     712        <xsl:if test="$fop.extensions != 0">
     713          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     714        </xsl:if>
     715      </xsl:attribute>
     716      <xsl:attribute name="margin-{$direction.align.end}">
     717        <xsl:value-of select="$page.margin.outer"/>
     718      </xsl:attribute>
    404719      <xsl:if test="$axf.extensions != 0">
    405720        <xsl:call-template name="axf-page-master-properties">
     
    411726                      column-gap="{$column.gap.back}"
    412727                      column-count="{$column.count.back}">
     728        <xsl:attribute name="margin-{$direction.align.start}">
     729          <xsl:value-of select="$body.margin.inner"/>
     730        </xsl:attribute>
     731        <xsl:attribute name="margin-{$direction.align.end}">
     732          <xsl:value-of select="$body.margin.outer"/>
     733        </xsl:attribute>
    413734      </fo:region-body>
    414735      <fo:region-before region-name="xsl-region-before-first"
    415736                        extent="{$region.before.extent}"
     737                        precedence="{$region.before.precedence}"
    416738                        display-align="before"/>
    417739      <fo:region-after region-name="xsl-region-after-first"
    418740                       extent="{$region.after.extent}"
     741                        precedence="{$region.after.precedence}"
    419742                       display-align="after"/>
     743      <xsl:call-template name="region.inner">
     744        <xsl:with-param name="sequence">first</xsl:with-param>
     745        <xsl:with-param name="pageclass">back</xsl:with-param>
     746      </xsl:call-template>
     747      <xsl:call-template name="region.outer">
     748        <xsl:with-param name="sequence">first</xsl:with-param>
     749        <xsl:with-param name="pageclass">back</xsl:with-param>
     750      </xsl:call-template>
    420751    </fo:simple-page-master>
    421752
     
    424755                           page-height="{$page.height}"
    425756                           margin-top="{$page.margin.top}"
    426                            margin-bottom="{$page.margin.bottom}"
    427                            margin-left="{$margin.left.inner}"
    428                            margin-right="{$page.margin.outer}">
     757                           margin-bottom="{$page.margin.bottom}">
     758      <xsl:attribute name="margin-{$direction.align.start}">
     759        <xsl:value-of select="$page.margin.inner"/>
     760        <xsl:if test="$fop.extensions != 0">
     761          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     762        </xsl:if>
     763      </xsl:attribute>
     764      <xsl:attribute name="margin-{$direction.align.end}">
     765        <xsl:value-of select="$page.margin.outer"/>
     766      </xsl:attribute>
    429767      <xsl:if test="$axf.extensions != 0">
    430768        <xsl:call-template name="axf-page-master-properties">
     
    436774                      column-gap="{$column.gap.back}"
    437775                      column-count="{$column.count.back}">
     776        <xsl:attribute name="margin-{$direction.align.start}">
     777          <xsl:value-of select="$body.margin.inner"/>
     778        </xsl:attribute>
     779        <xsl:attribute name="margin-{$direction.align.end}">
     780          <xsl:value-of select="$body.margin.outer"/>
     781        </xsl:attribute>
    438782      </fo:region-body>
    439783      <fo:region-before region-name="xsl-region-before-odd"
    440784                        extent="{$region.before.extent}"
     785                        precedence="{$region.before.precedence}"
    441786                        display-align="before"/>
    442787      <fo:region-after region-name="xsl-region-after-odd"
    443788                       extent="{$region.after.extent}"
     789                        precedence="{$region.after.precedence}"
    444790                       display-align="after"/>
     791      <xsl:call-template name="region.inner">
     792        <xsl:with-param name="sequence">odd</xsl:with-param>
     793        <xsl:with-param name="pageclass">back</xsl:with-param>
     794      </xsl:call-template>
     795      <xsl:call-template name="region.outer">
     796        <xsl:with-param name="sequence">odd</xsl:with-param>
     797        <xsl:with-param name="pageclass">back</xsl:with-param>
     798      </xsl:call-template>
    445799    </fo:simple-page-master>
    446800
     
    449803                           page-height="{$page.height}"
    450804                           margin-top="{$page.margin.top}"
    451                            margin-bottom="{$page.margin.bottom}"
    452                            margin-left="{$margin.left.outer}"
    453                            margin-right="{$page.margin.inner}">
     805                           margin-bottom="{$page.margin.bottom}">
     806      <xsl:attribute name="margin-{$direction.align.start}">
     807        <xsl:value-of select="$page.margin.outer"/>
     808        <xsl:if test="$fop.extensions != 0">
     809          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     810        </xsl:if>
     811      </xsl:attribute>
     812      <xsl:attribute name="margin-{$direction.align.end}">
     813        <xsl:value-of select="$page.margin.inner"/>
     814      </xsl:attribute>
    454815      <xsl:if test="$axf.extensions != 0">
    455816        <xsl:call-template name="axf-page-master-properties">
     
    461822                      column-gap="{$column.gap.back}"
    462823                      column-count="{$column.count.back}">
     824        <xsl:attribute name="margin-{$direction.align.start}">
     825          <xsl:value-of select="$body.margin.outer"/>
     826        </xsl:attribute>
     827        <xsl:attribute name="margin-{$direction.align.end}">
     828          <xsl:value-of select="$body.margin.inner"/>
     829        </xsl:attribute>
    463830      </fo:region-body>
    464831      <fo:region-before region-name="xsl-region-before-even"
    465832                        extent="{$region.before.extent}"
     833                        precedence="{$region.before.precedence}"
    466834                        display-align="before"/>
    467835      <fo:region-after region-name="xsl-region-after-even"
    468836                       extent="{$region.after.extent}"
     837                        precedence="{$region.after.precedence}"
    469838                       display-align="after"/>
     839      <xsl:call-template name="region.outer">
     840        <xsl:with-param name="sequence">even</xsl:with-param>
     841        <xsl:with-param name="pageclass">back</xsl:with-param>
     842      </xsl:call-template>
     843      <xsl:call-template name="region.inner">
     844        <xsl:with-param name="sequence">even</xsl:with-param>
     845        <xsl:with-param name="pageclass">back</xsl:with-param>
     846      </xsl:call-template>
    470847    </fo:simple-page-master>
    471848
     
    475852                           page-height="{$page.height}"
    476853                           margin-top="{$page.margin.top}"
    477                            margin-bottom="{$page.margin.bottom}"
    478                            margin-left="{$page.margin.inner}"
    479                            margin-right="{$page.margin.outer}">
     854                           margin-bottom="{$page.margin.bottom}">
     855      <xsl:attribute name="margin-{$direction.align.start}">
     856        <xsl:value-of select="$page.margin.inner"/>
     857        <xsl:if test="$fop.extensions != 0">
     858          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     859        </xsl:if>
     860      </xsl:attribute>
     861      <xsl:attribute name="margin-{$direction.align.end}">
     862        <xsl:value-of select="$page.margin.outer"/>
     863      </xsl:attribute>
    480864      <xsl:if test="$axf.extensions != 0">
    481865        <xsl:call-template name="axf-page-master-properties">
     
    487871                      column-gap="{$column.gap.index}"
    488872                      column-count="{$column.count.index}">
     873        <xsl:attribute name="margin-{$direction.align.start}">
     874          <xsl:value-of select="$body.margin.inner"/>
     875        </xsl:attribute>
     876        <xsl:attribute name="margin-{$direction.align.end}">
     877          <xsl:value-of select="$body.margin.outer"/>
     878        </xsl:attribute>
    489879      </fo:region-body>
    490880      <fo:region-before region-name="xsl-region-before-first"
    491881                        extent="{$region.before.extent}"
     882                        precedence="{$region.before.precedence}"
    492883                        display-align="before"/>
    493884      <fo:region-after region-name="xsl-region-after-first"
    494885                       extent="{$region.after.extent}"
     886                        precedence="{$region.after.precedence}"
    495887                       display-align="after"/>
     888      <xsl:call-template name="region.inner">
     889        <xsl:with-param name="sequence">first</xsl:with-param>
     890        <xsl:with-param name="pageclass">index</xsl:with-param>
     891      </xsl:call-template>
     892      <xsl:call-template name="region.outer">
     893        <xsl:with-param name="sequence">first</xsl:with-param>
     894        <xsl:with-param name="pageclass">index</xsl:with-param>
     895      </xsl:call-template>
    496896    </fo:simple-page-master>
    497897
     
    500900                           page-height="{$page.height}"
    501901                           margin-top="{$page.margin.top}"
    502                            margin-bottom="{$page.margin.bottom}"
    503                            margin-left="{$page.margin.inner}"
    504                            margin-right="{$page.margin.outer}">
     902                           margin-bottom="{$page.margin.bottom}">
     903      <xsl:attribute name="margin-{$direction.align.start}">
     904        <xsl:value-of select="$page.margin.inner"/>
     905        <xsl:if test="$fop.extensions != 0">
     906          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     907        </xsl:if>
     908      </xsl:attribute>
     909      <xsl:attribute name="margin-{$direction.align.end}">
     910        <xsl:value-of select="$page.margin.outer"/>
     911      </xsl:attribute>
    505912      <xsl:if test="$axf.extensions != 0">
    506913        <xsl:call-template name="axf-page-master-properties">
     
    512919                      column-gap="{$column.gap.index}"
    513920                      column-count="{$column.count.index}">
     921        <xsl:attribute name="margin-{$direction.align.start}">
     922          <xsl:value-of select="$body.margin.inner"/>
     923        </xsl:attribute>
     924        <xsl:attribute name="margin-{$direction.align.end}">
     925          <xsl:value-of select="$body.margin.outer"/>
     926        </xsl:attribute>
    514927      </fo:region-body>
    515928      <fo:region-before region-name="xsl-region-before-odd"
    516929                        extent="{$region.before.extent}"
     930                        precedence="{$region.before.precedence}"
    517931                        display-align="before"/>
    518932      <fo:region-after region-name="xsl-region-after-odd"
    519933                       extent="{$region.after.extent}"
     934                        precedence="{$region.after.precedence}"
    520935                       display-align="after"/>
     936      <xsl:call-template name="region.inner">
     937        <xsl:with-param name="sequence">odd</xsl:with-param>
     938        <xsl:with-param name="pageclass">index</xsl:with-param>
     939      </xsl:call-template>
     940      <xsl:call-template name="region.outer">
     941        <xsl:with-param name="sequence">odd</xsl:with-param>
     942        <xsl:with-param name="pageclass">index</xsl:with-param>
     943      </xsl:call-template>
    521944    </fo:simple-page-master>
    522945
     
    525948                           page-height="{$page.height}"
    526949                           margin-top="{$page.margin.top}"
    527                            margin-bottom="{$page.margin.bottom}"
    528                            margin-left="{$page.margin.outer}"
    529                            margin-right="{$page.margin.inner}">
     950                           margin-bottom="{$page.margin.bottom}">
     951      <xsl:attribute name="margin-{$direction.align.start}">
     952        <xsl:value-of select="$page.margin.outer"/>
     953        <xsl:if test="$fop.extensions != 0">
     954          <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     955        </xsl:if>
     956      </xsl:attribute>
     957      <xsl:attribute name="margin-{$direction.align.end}">
     958        <xsl:value-of select="$page.margin.inner"/>
     959      </xsl:attribute>
    530960      <xsl:if test="$axf.extensions != 0">
    531961        <xsl:call-template name="axf-page-master-properties">
     
    537967                      column-gap="{$column.gap.index}"
    538968                      column-count="{$column.count.index}">
     969        <xsl:attribute name="margin-{$direction.align.start}">
     970          <xsl:value-of select="$body.margin.outer"/>
     971        </xsl:attribute>
     972        <xsl:attribute name="margin-{$direction.align.end}">
     973          <xsl:value-of select="$body.margin.inner"/>
     974        </xsl:attribute>
    539975      </fo:region-body>
    540976      <fo:region-before region-name="xsl-region-before-even"
    541977                        extent="{$region.before.extent}"
     978                        precedence="{$region.before.precedence}"
    542979                        display-align="before"/>
    543980      <fo:region-after region-name="xsl-region-after-even"
    544981                       extent="{$region.after.extent}"
     982                        precedence="{$region.after.precedence}"
    545983                       display-align="after"/>
     984      <xsl:call-template name="region.outer">
     985        <xsl:with-param name="sequence">even</xsl:with-param>
     986        <xsl:with-param name="pageclass">index</xsl:with-param>
     987      </xsl:call-template>
     988      <xsl:call-template name="region.inner">
     989        <xsl:with-param name="sequence">even</xsl:with-param>
     990        <xsl:with-param name="pageclass">index</xsl:with-param>
     991      </xsl:call-template>
    546992    </fo:simple-page-master>
    547993
     
    552998                             page-height="{$page.height}"
    553999                             margin-top="{$page.margin.top}"
    554                              margin-bottom="{$page.margin.bottom}"
    555                              margin-left="{$margin.left.outer}"
    556                              margin-right="{$page.margin.inner}">
     1000                             margin-bottom="{$page.margin.bottom}">
     1001        <xsl:attribute name="margin-{$direction.align.start}">
     1002          <xsl:value-of select="$page.margin.outer"/>
     1003          <xsl:if test="$fop.extensions != 0">
     1004            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1005          </xsl:if>
     1006        </xsl:attribute>
     1007        <xsl:attribute name="margin-{$direction.align.end}">
     1008          <xsl:value-of select="$page.margin.inner"/>
     1009        </xsl:attribute>
    5571010        <xsl:if test="$axf.extensions != 0">
    5581011          <xsl:call-template name="axf-page-master-properties">
     
    5621015        <fo:region-body margin-bottom="{$body.margin.bottom}"
    5631016                        margin-top="{$body.margin.top}">
     1017          <xsl:attribute name="margin-{$direction.align.start}">
     1018            <xsl:value-of select="$body.margin.outer"/>
     1019          </xsl:attribute>
     1020          <xsl:attribute name="margin-{$direction.align.end}">
     1021            <xsl:value-of select="$body.margin.inner"/>
     1022          </xsl:attribute>
    5641023          <xsl:if test="$draft.watermark.image != ''">
    5651024            <xsl:attribute name="background-image">
     
    5761035        <fo:region-before region-name="xsl-region-before-blank"
    5771036                          extent="{$region.before.extent}"
     1037                          precedence="{$region.before.precedence}"
    5781038                          display-align="before"/>
    5791039        <fo:region-after region-name="xsl-region-after-blank"
    5801040                         extent="{$region.after.extent}"
     1041                          precedence="{$region.after.precedence}"
    5811042                         display-align="after"/>
     1043        <xsl:call-template name="region.outer">
     1044          <xsl:with-param name="sequence">blank</xsl:with-param>
     1045          <xsl:with-param name="pageclass">blank</xsl:with-param>
     1046        </xsl:call-template>
     1047        <xsl:call-template name="region.inner">
     1048          <xsl:with-param name="sequence">blank</xsl:with-param>
     1049          <xsl:with-param name="pageclass">blank</xsl:with-param>
     1050        </xsl:call-template>
    5821051      </fo:simple-page-master>
    5831052
     
    5871056                             page-height="{$page.height}"
    5881057                             margin-top="{$page.margin.top}"
    589                              margin-bottom="{$page.margin.bottom}"
    590                              margin-left="{$margin.left.inner}"
    591                              margin-right="{$page.margin.outer}">
     1058                             margin-bottom="{$page.margin.bottom}">
     1059        <xsl:attribute name="margin-{$direction.align.start}">
     1060          <xsl:value-of select="$page.margin.inner"/>
     1061          <xsl:if test="$fop.extensions != 0">
     1062            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1063          </xsl:if>
     1064        </xsl:attribute>
     1065        <xsl:attribute name="margin-{$direction.align.end}">
     1066          <xsl:value-of select="$page.margin.outer"/>
     1067        </xsl:attribute>
    5921068        <xsl:if test="$axf.extensions != 0">
    5931069          <xsl:call-template name="axf-page-master-properties">
     
    5991075                        column-gap="{$column.gap.titlepage}"
    6001076                        column-count="{$column.count.titlepage}">
     1077          <xsl:attribute name="margin-{$direction.align.start}">
     1078            <xsl:value-of select="$body.margin.inner"/>
     1079          </xsl:attribute>
     1080          <xsl:attribute name="margin-{$direction.align.end}">
     1081            <xsl:value-of select="$body.margin.outer"/>
     1082          </xsl:attribute>
    6011083          <xsl:if test="$draft.watermark.image != ''">
    6021084            <xsl:attribute name="background-image">
     
    6131095        <fo:region-before region-name="xsl-region-before-first"
    6141096                          extent="{$region.before.extent}"
     1097                          precedence="{$region.before.precedence}"
    6151098                          display-align="before"/>
    6161099        <fo:region-after region-name="xsl-region-after-first"
    6171100                         extent="{$region.after.extent}"
     1101                          precedence="{$region.after.precedence}"
    6181102                         display-align="after"/>
     1103        <xsl:call-template name="region.inner">
     1104          <xsl:with-param name="sequence">first</xsl:with-param>
     1105          <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     1106        </xsl:call-template>
     1107        <xsl:call-template name="region.outer">
     1108          <xsl:with-param name="sequence">first</xsl:with-param>
     1109          <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     1110        </xsl:call-template>
    6191111      </fo:simple-page-master>
    6201112
     
    6231115                             page-height="{$page.height}"
    6241116                             margin-top="{$page.margin.top}"
    625                              margin-bottom="{$page.margin.bottom}"
    626                              margin-left="{$margin.left.inner}"
    627                              margin-right="{$page.margin.outer}">
     1117                             margin-bottom="{$page.margin.bottom}">
     1118        <xsl:attribute name="margin-{$direction.align.start}">
     1119          <xsl:value-of select="$page.margin.inner"/>
     1120          <xsl:if test="$fop.extensions != 0">
     1121            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1122          </xsl:if>
     1123        </xsl:attribute>
     1124        <xsl:attribute name="margin-{$direction.align.end}">
     1125          <xsl:value-of select="$page.margin.outer"/>
     1126        </xsl:attribute>
    6281127        <xsl:if test="$axf.extensions != 0">
    6291128          <xsl:call-template name="axf-page-master-properties">
     
    6351134                        column-gap="{$column.gap.titlepage}"
    6361135                        column-count="{$column.count.titlepage}">
     1136          <xsl:attribute name="margin-{$direction.align.start}">
     1137            <xsl:value-of select="$body.margin.inner"/>
     1138          </xsl:attribute>
     1139          <xsl:attribute name="margin-{$direction.align.end}">
     1140            <xsl:value-of select="$body.margin.outer"/>
     1141          </xsl:attribute>
    6371142          <xsl:if test="$draft.watermark.image != ''">
    6381143            <xsl:attribute name="background-image">
     
    6491154        <fo:region-before region-name="xsl-region-before-odd"
    6501155                          extent="{$region.before.extent}"
     1156                          precedence="{$region.before.precedence}"
    6511157                          display-align="before"/>
    6521158        <fo:region-after region-name="xsl-region-after-odd"
    6531159                         extent="{$region.after.extent}"
     1160                          precedence="{$region.after.precedence}"
    6541161                         display-align="after"/>
     1162        <xsl:call-template name="region.inner">
     1163          <xsl:with-param name="sequence">odd</xsl:with-param>
     1164          <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     1165        </xsl:call-template>
     1166        <xsl:call-template name="region.outer">
     1167          <xsl:with-param name="sequence">odd</xsl:with-param>
     1168          <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     1169        </xsl:call-template>
    6551170      </fo:simple-page-master>
    6561171
     
    6591174                             page-height="{$page.height}"
    6601175                             margin-top="{$page.margin.top}"
    661                              margin-bottom="{$page.margin.bottom}"
    662                              margin-left="{$margin.left.outer}"
    663                              margin-right="{$page.margin.inner}">
     1176                             margin-bottom="{$page.margin.bottom}">
     1177        <xsl:attribute name="margin-{$direction.align.start}">
     1178          <xsl:value-of select="$page.margin.outer"/>
     1179          <xsl:if test="$fop.extensions != 0">
     1180            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1181          </xsl:if>
     1182        </xsl:attribute>
     1183        <xsl:attribute name="margin-{$direction.align.end}">
     1184          <xsl:value-of select="$page.margin.inner"/>
     1185        </xsl:attribute>
    6641186        <xsl:if test="$axf.extensions != 0">
    6651187          <xsl:call-template name="axf-page-master-properties">
     
    6711193                        column-gap="{$column.gap.titlepage}"
    6721194                        column-count="{$column.count.titlepage}">
     1195          <xsl:attribute name="margin-{$direction.align.start}">
     1196            <xsl:value-of select="$body.margin.outer"/>
     1197          </xsl:attribute>
     1198          <xsl:attribute name="margin-{$direction.align.end}">
     1199            <xsl:value-of select="$body.margin.inner"/>
     1200          </xsl:attribute>
    6731201          <xsl:if test="$draft.watermark.image != ''">
    6741202            <xsl:attribute name="background-image">
     
    6851213        <fo:region-before region-name="xsl-region-before-even"
    6861214                          extent="{$region.before.extent}"
     1215                          precedence="{$region.before.precedence}"
    6871216                          display-align="before"/>
    6881217        <fo:region-after region-name="xsl-region-after-even"
    6891218                         extent="{$region.after.extent}"
     1219                          precedence="{$region.after.precedence}"
    6901220                         display-align="after"/>
     1221        <xsl:call-template name="region.outer">
     1222          <xsl:with-param name="sequence">even</xsl:with-param>
     1223          <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     1224        </xsl:call-template>
     1225        <xsl:call-template name="region.inner">
     1226          <xsl:with-param name="sequence">even</xsl:with-param>
     1227          <xsl:with-param name="pageclass">titlepage</xsl:with-param>
     1228        </xsl:call-template>
    6911229      </fo:simple-page-master>
    6921230
     
    6961234                             page-height="{$page.height}"
    6971235                             margin-top="{$page.margin.top}"
    698                              margin-bottom="{$page.margin.bottom}"
    699                              margin-left="{$margin.left.inner}"
    700                              margin-right="{$page.margin.outer}">
     1236                             margin-bottom="{$page.margin.bottom}">
     1237        <xsl:attribute name="margin-{$direction.align.start}">
     1238          <xsl:value-of select="$page.margin.inner"/>
     1239          <xsl:if test="$fop.extensions != 0">
     1240            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1241          </xsl:if>
     1242        </xsl:attribute>
     1243        <xsl:attribute name="margin-{$direction.align.end}">
     1244          <xsl:value-of select="$page.margin.outer"/>
     1245        </xsl:attribute>
    7011246        <xsl:if test="$axf.extensions != 0">
    7021247          <xsl:call-template name="axf-page-master-properties">
     
    7081253                        column-gap="{$column.gap.lot}"
    7091254                        column-count="{$column.count.lot}">
     1255          <xsl:attribute name="margin-{$direction.align.start}">
     1256            <xsl:value-of select="$body.margin.inner"/>
     1257          </xsl:attribute>
     1258          <xsl:attribute name="margin-{$direction.align.end}">
     1259            <xsl:value-of select="$body.margin.outer"/>
     1260          </xsl:attribute>
    7101261          <xsl:if test="$draft.watermark.image != ''">
    7111262            <xsl:attribute name="background-image">
     
    7221273        <fo:region-before region-name="xsl-region-before-first"
    7231274                          extent="{$region.before.extent}"
     1275                          precedence="{$region.before.precedence}"
    7241276                          display-align="before"/>
    7251277        <fo:region-after region-name="xsl-region-after-first"
    7261278                         extent="{$region.after.extent}"
     1279                          precedence="{$region.after.precedence}"
    7271280                         display-align="after"/>
     1281        <xsl:call-template name="region.inner">
     1282          <xsl:with-param name="sequence">first</xsl:with-param>
     1283          <xsl:with-param name="pageclass">lot</xsl:with-param>
     1284        </xsl:call-template>
     1285        <xsl:call-template name="region.outer">
     1286          <xsl:with-param name="sequence">first</xsl:with-param>
     1287          <xsl:with-param name="pageclass">lot</xsl:with-param>
     1288        </xsl:call-template>
    7281289      </fo:simple-page-master>
    7291290
     
    7321293                             page-height="{$page.height}"
    7331294                             margin-top="{$page.margin.top}"
    734                              margin-bottom="{$page.margin.bottom}"
    735                              margin-left="{$margin.left.inner}"
    736                              margin-right="{$page.margin.outer}">
     1295                             margin-bottom="{$page.margin.bottom}">
     1296        <xsl:attribute name="margin-{$direction.align.start}">
     1297          <xsl:value-of select="$page.margin.inner"/>
     1298          <xsl:if test="$fop.extensions != 0">
     1299            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1300          </xsl:if>
     1301        </xsl:attribute>
     1302        <xsl:attribute name="margin-{$direction.align.end}">
     1303          <xsl:value-of select="$page.margin.outer"/>
     1304        </xsl:attribute>
    7371305        <xsl:if test="$axf.extensions != 0">
    7381306          <xsl:call-template name="axf-page-master-properties">
     
    7441312                        column-gap="{$column.gap.lot}"
    7451313                        column-count="{$column.count.lot}">
     1314          <xsl:attribute name="margin-{$direction.align.start}">
     1315            <xsl:value-of select="$body.margin.inner"/>
     1316          </xsl:attribute>
     1317          <xsl:attribute name="margin-{$direction.align.end}">
     1318            <xsl:value-of select="$body.margin.outer"/>
     1319          </xsl:attribute>
    7461320          <xsl:if test="$draft.watermark.image != ''">
    7471321            <xsl:attribute name="background-image">
     
    7581332        <fo:region-before region-name="xsl-region-before-odd"
    7591333                          extent="{$region.before.extent}"
     1334                          precedence="{$region.before.precedence}"
    7601335                          display-align="before"/>
    7611336        <fo:region-after region-name="xsl-region-after-odd"
    7621337                         extent="{$region.after.extent}"
     1338                          precedence="{$region.after.precedence}"
    7631339                         display-align="after"/>
     1340        <xsl:call-template name="region.inner">
     1341          <xsl:with-param name="sequence">odd</xsl:with-param>
     1342          <xsl:with-param name="pageclass">lot</xsl:with-param>
     1343        </xsl:call-template>
     1344        <xsl:call-template name="region.outer">
     1345          <xsl:with-param name="sequence">odd</xsl:with-param>
     1346          <xsl:with-param name="pageclass">lot</xsl:with-param>
     1347        </xsl:call-template>
    7641348      </fo:simple-page-master>
    7651349
     
    7681352                             page-height="{$page.height}"
    7691353                             margin-top="{$page.margin.top}"
    770                              margin-bottom="{$page.margin.bottom}"
    771                              margin-left="{$margin.left.outer}"
    772                              margin-right="{$page.margin.inner}">
     1354                             margin-bottom="{$page.margin.bottom}">
     1355        <xsl:attribute name="margin-{$direction.align.start}">
     1356          <xsl:value-of select="$page.margin.outer"/>
     1357          <xsl:if test="$fop.extensions != 0">
     1358            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1359          </xsl:if>
     1360        </xsl:attribute>
     1361        <xsl:attribute name="margin-{$direction.align.end}">
     1362          <xsl:value-of select="$page.margin.inner"/>
     1363        </xsl:attribute>
    7731364        <xsl:if test="$axf.extensions != 0">
    7741365          <xsl:call-template name="axf-page-master-properties">
     
    7801371                        column-gap="{$column.gap.lot}"
    7811372                        column-count="{$column.count.lot}">
     1373          <xsl:attribute name="margin-{$direction.align.start}">
     1374            <xsl:value-of select="$body.margin.outer"/>
     1375          </xsl:attribute>
     1376          <xsl:attribute name="margin-{$direction.align.end}">
     1377            <xsl:value-of select="$body.margin.inner"/>
     1378          </xsl:attribute>
    7821379          <xsl:if test="$draft.watermark.image != ''">
    7831380            <xsl:attribute name="background-image">
     
    7941391        <fo:region-before region-name="xsl-region-before-even"
    7951392                          extent="{$region.before.extent}"
     1393                          precedence="{$region.before.precedence}"
    7961394                          display-align="before"/>
    7971395        <fo:region-after region-name="xsl-region-after-even"
    7981396                         extent="{$region.after.extent}"
     1397                          precedence="{$region.after.precedence}"
    7991398                         display-align="after"/>
     1399        <xsl:call-template name="region.outer">
     1400          <xsl:with-param name="sequence">even</xsl:with-param>
     1401          <xsl:with-param name="pageclass">lot</xsl:with-param>
     1402        </xsl:call-template>
     1403        <xsl:call-template name="region.inner">
     1404          <xsl:with-param name="sequence">even</xsl:with-param>
     1405          <xsl:with-param name="pageclass">lot</xsl:with-param>
     1406        </xsl:call-template>
    8001407      </fo:simple-page-master>
    8011408
     
    8051412                             page-height="{$page.height}"
    8061413                             margin-top="{$page.margin.top}"
    807                              margin-bottom="{$page.margin.bottom}"
    808                              margin-left="{$margin.left.inner}"
    809                              margin-right="{$page.margin.outer}">
     1414                             margin-bottom="{$page.margin.bottom}">
     1415        <xsl:attribute name="margin-{$direction.align.start}">
     1416          <xsl:value-of select="$page.margin.inner"/>
     1417          <xsl:if test="$fop.extensions != 0">
     1418            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1419          </xsl:if>
     1420        </xsl:attribute>
     1421        <xsl:attribute name="margin-{$direction.align.end}">
     1422          <xsl:value-of select="$page.margin.outer"/>
     1423        </xsl:attribute>
    8101424        <xsl:if test="$axf.extensions != 0">
    8111425          <xsl:call-template name="axf-page-master-properties">
     
    8171431                        column-gap="{$column.gap.front}"
    8181432                        column-count="{$column.count.front}">
     1433          <xsl:attribute name="margin-{$direction.align.start}">
     1434            <xsl:value-of select="$body.margin.inner"/>
     1435          </xsl:attribute>
     1436          <xsl:attribute name="margin-{$direction.align.end}">
     1437            <xsl:value-of select="$body.margin.outer"/>
     1438          </xsl:attribute>
    8191439          <xsl:if test="$draft.watermark.image != ''">
    8201440            <xsl:attribute name="background-image">
     
    8311451        <fo:region-before region-name="xsl-region-before-first"
    8321452                          extent="{$region.before.extent}"
     1453                          precedence="{$region.before.precedence}"
    8331454                          display-align="before"/>
    8341455        <fo:region-after region-name="xsl-region-after-first"
    8351456                         extent="{$region.after.extent}"
     1457                          precedence="{$region.after.precedence}"
    8361458                         display-align="after"/>
     1459        <xsl:call-template name="region.inner">
     1460          <xsl:with-param name="sequence">first</xsl:with-param>
     1461          <xsl:with-param name="pageclass">front</xsl:with-param>
     1462        </xsl:call-template>
     1463        <xsl:call-template name="region.outer">
     1464          <xsl:with-param name="sequence">first</xsl:with-param>
     1465          <xsl:with-param name="pageclass">front</xsl:with-param>
     1466        </xsl:call-template>
    8371467      </fo:simple-page-master>
    8381468
     
    8411471                             page-height="{$page.height}"
    8421472                             margin-top="{$page.margin.top}"
    843                              margin-bottom="{$page.margin.bottom}"
    844                              margin-left="{$margin.left.inner}"
    845                              margin-right="{$page.margin.outer}">
     1473                             margin-bottom="{$page.margin.bottom}">
     1474        <xsl:attribute name="margin-{$direction.align.start}">
     1475          <xsl:value-of select="$page.margin.inner"/>
     1476          <xsl:if test="$fop.extensions != 0">
     1477            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1478          </xsl:if>
     1479        </xsl:attribute>
     1480        <xsl:attribute name="margin-{$direction.align.end}">
     1481          <xsl:value-of select="$page.margin.outer"/>
     1482        </xsl:attribute>
    8461483        <xsl:if test="$axf.extensions != 0">
    8471484          <xsl:call-template name="axf-page-master-properties">
     
    8531490                        column-gap="{$column.gap.front}"
    8541491                        column-count="{$column.count.front}">
     1492          <xsl:attribute name="margin-{$direction.align.start}">
     1493            <xsl:value-of select="$body.margin.inner"/>
     1494          </xsl:attribute>
     1495          <xsl:attribute name="margin-{$direction.align.end}">
     1496            <xsl:value-of select="$body.margin.outer"/>
     1497          </xsl:attribute>
    8551498          <xsl:if test="$draft.watermark.image != ''">
    8561499            <xsl:attribute name="background-image">
     
    8671510        <fo:region-before region-name="xsl-region-before-odd"
    8681511                          extent="{$region.before.extent}"
     1512                          precedence="{$region.before.precedence}"
    8691513                          display-align="before"/>
    8701514        <fo:region-after region-name="xsl-region-after-odd"
    8711515                         extent="{$region.after.extent}"
     1516                          precedence="{$region.after.precedence}"
    8721517                         display-align="after"/>
     1518        <xsl:call-template name="region.inner">
     1519          <xsl:with-param name="sequence">odd</xsl:with-param>
     1520          <xsl:with-param name="pageclass">front</xsl:with-param>
     1521        </xsl:call-template>
     1522        <xsl:call-template name="region.outer">
     1523          <xsl:with-param name="sequence">odd</xsl:with-param>
     1524          <xsl:with-param name="pageclass">front</xsl:with-param>
     1525        </xsl:call-template>
    8731526      </fo:simple-page-master>
    8741527
     
    8771530                             page-height="{$page.height}"
    8781531                             margin-top="{$page.margin.top}"
    879                              margin-bottom="{$page.margin.bottom}"
    880                              margin-left="{$margin.left.outer}"
    881                              margin-right="{$page.margin.inner}">
     1532                             margin-bottom="{$page.margin.bottom}">
     1533        <xsl:attribute name="margin-{$direction.align.start}">
     1534          <xsl:value-of select="$page.margin.outer"/>
     1535          <xsl:if test="$fop.extensions != 0">
     1536            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1537          </xsl:if>
     1538        </xsl:attribute>
     1539        <xsl:attribute name="margin-{$direction.align.end}">
     1540          <xsl:value-of select="$page.margin.inner"/>
     1541        </xsl:attribute>
    8821542        <xsl:if test="$axf.extensions != 0">
    8831543          <xsl:call-template name="axf-page-master-properties">
     
    8891549                        column-gap="{$column.gap.front}"
    8901550                        column-count="{$column.count.front}">
     1551          <xsl:attribute name="margin-{$direction.align.start}">
     1552            <xsl:value-of select="$body.margin.outer"/>
     1553          </xsl:attribute>
     1554          <xsl:attribute name="margin-{$direction.align.end}">
     1555            <xsl:value-of select="$body.margin.inner"/>
     1556          </xsl:attribute>
    8911557          <xsl:if test="$draft.watermark.image != ''">
    8921558            <xsl:attribute name="background-image">
     
    9031569        <fo:region-before region-name="xsl-region-before-even"
    9041570                          extent="{$region.before.extent}"
     1571                          precedence="{$region.before.precedence}"
    9051572                          display-align="before"/>
    9061573        <fo:region-after region-name="xsl-region-after-even"
    9071574                         extent="{$region.after.extent}"
     1575                          precedence="{$region.after.precedence}"
    9081576                         display-align="after"/>
     1577        <xsl:call-template name="region.outer">
     1578          <xsl:with-param name="sequence">even</xsl:with-param>
     1579          <xsl:with-param name="pageclass">front</xsl:with-param>
     1580        </xsl:call-template>
     1581        <xsl:call-template name="region.inner">
     1582          <xsl:with-param name="sequence">even</xsl:with-param>
     1583          <xsl:with-param name="pageclass">front</xsl:with-param>
     1584        </xsl:call-template>
    9091585      </fo:simple-page-master>
    9101586
     
    9141590                             page-height="{$page.height}"
    9151591                             margin-top="{$page.margin.top}"
    916                              margin-bottom="{$page.margin.bottom}"
    917                              margin-left="{$margin.left.inner}"
    918                              margin-right="{$page.margin.outer}">
     1592                             margin-bottom="{$page.margin.bottom}">
     1593        <xsl:attribute name="margin-{$direction.align.start}">
     1594          <xsl:value-of select="$page.margin.inner"/>
     1595          <xsl:if test="$fop.extensions != 0">
     1596            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1597          </xsl:if>
     1598        </xsl:attribute>
     1599        <xsl:attribute name="margin-{$direction.align.end}">
     1600          <xsl:value-of select="$page.margin.outer"/>
     1601        </xsl:attribute>
    9191602        <xsl:if test="$axf.extensions != 0">
    9201603          <xsl:call-template name="axf-page-master-properties">
     
    9261609                        column-gap="{$column.gap.body}"
    9271610                        column-count="{$column.count.body}">
     1611          <xsl:attribute name="margin-{$direction.align.start}">
     1612            <xsl:value-of select="$body.margin.inner"/>
     1613          </xsl:attribute>
     1614          <xsl:attribute name="margin-{$direction.align.end}">
     1615            <xsl:value-of select="$body.margin.outer"/>
     1616          </xsl:attribute>
    9281617          <xsl:if test="$draft.watermark.image != ''">
    9291618            <xsl:attribute name="background-image">
     
    9401629        <fo:region-before region-name="xsl-region-before-first"
    9411630                          extent="{$region.before.extent}"
     1631                          precedence="{$region.before.precedence}"
    9421632                          display-align="before"/>
    9431633        <fo:region-after region-name="xsl-region-after-first"
    9441634                         extent="{$region.after.extent}"
     1635                          precedence="{$region.after.precedence}"
    9451636                         display-align="after"/>
     1637        <xsl:call-template name="region.inner">
     1638          <xsl:with-param name="sequence">first</xsl:with-param>
     1639          <xsl:with-param name="pageclass">body</xsl:with-param>
     1640        </xsl:call-template>
     1641        <xsl:call-template name="region.outer">
     1642          <xsl:with-param name="sequence">first</xsl:with-param>
     1643          <xsl:with-param name="pageclass">body</xsl:with-param>
     1644        </xsl:call-template>
    9461645      </fo:simple-page-master>
    9471646
     
    9501649                             page-height="{$page.height}"
    9511650                             margin-top="{$page.margin.top}"
    952                              margin-bottom="{$page.margin.bottom}"
    953                              margin-left="{$margin.left.inner}"
    954                              margin-right="{$page.margin.outer}">
     1651                             margin-bottom="{$page.margin.bottom}">
     1652        <xsl:attribute name="margin-{$direction.align.start}">
     1653          <xsl:value-of select="$page.margin.inner"/>
     1654          <xsl:if test="$fop.extensions != 0">
     1655            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1656          </xsl:if>
     1657        </xsl:attribute>
     1658        <xsl:attribute name="margin-{$direction.align.end}">
     1659          <xsl:value-of select="$page.margin.outer"/>
     1660        </xsl:attribute>
    9551661        <xsl:if test="$axf.extensions != 0">
    9561662          <xsl:call-template name="axf-page-master-properties">
     
    9621668                        column-gap="{$column.gap.body}"
    9631669                        column-count="{$column.count.body}">
     1670          <xsl:attribute name="margin-{$direction.align.start}">
     1671            <xsl:value-of select="$body.margin.inner"/>
     1672          </xsl:attribute>
     1673          <xsl:attribute name="margin-{$direction.align.end}">
     1674            <xsl:value-of select="$body.margin.outer"/>
     1675          </xsl:attribute>
    9641676          <xsl:if test="$draft.watermark.image != ''">
    9651677            <xsl:attribute name="background-image">
     
    9761688        <fo:region-before region-name="xsl-region-before-odd"
    9771689                          extent="{$region.before.extent}"
     1690                          precedence="{$region.before.precedence}"
    9781691                          display-align="before"/>
    9791692        <fo:region-after region-name="xsl-region-after-odd"
    9801693                         extent="{$region.after.extent}"
     1694                          precedence="{$region.after.precedence}"
    9811695                         display-align="after"/>
     1696        <xsl:call-template name="region.inner">
     1697          <xsl:with-param name="sequence">odd</xsl:with-param>
     1698          <xsl:with-param name="pageclass">body</xsl:with-param>
     1699        </xsl:call-template>
     1700        <xsl:call-template name="region.outer">
     1701          <xsl:with-param name="sequence">odd</xsl:with-param>
     1702          <xsl:with-param name="pageclass">body</xsl:with-param>
     1703        </xsl:call-template>
    9821704      </fo:simple-page-master>
    9831705
     
    9861708                             page-height="{$page.height}"
    9871709                             margin-top="{$page.margin.top}"
    988                              margin-bottom="{$page.margin.bottom}"
    989                              margin-left="{$margin.left.outer}"
    990                              margin-right="{$page.margin.inner}">
     1710                             margin-bottom="{$page.margin.bottom}">
     1711        <xsl:attribute name="margin-{$direction.align.start}">
     1712          <xsl:value-of select="$page.margin.outer"/>
     1713          <xsl:if test="$fop.extensions != 0">
     1714            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1715          </xsl:if>
     1716        </xsl:attribute>
     1717        <xsl:attribute name="margin-{$direction.align.end}">
     1718          <xsl:value-of select="$page.margin.inner"/>
     1719        </xsl:attribute>
    9911720        <xsl:if test="$axf.extensions != 0">
    9921721          <xsl:call-template name="axf-page-master-properties">
     
    9981727                        column-gap="{$column.gap.body}"
    9991728                        column-count="{$column.count.body}">
     1729          <xsl:attribute name="margin-{$direction.align.start}">
     1730            <xsl:value-of select="$body.margin.outer"/>
     1731          </xsl:attribute>
     1732          <xsl:attribute name="margin-{$direction.align.end}">
     1733            <xsl:value-of select="$body.margin.inner"/>
     1734          </xsl:attribute>
    10001735          <xsl:if test="$draft.watermark.image != ''">
    10011736            <xsl:attribute name="background-image">
     
    10121747        <fo:region-before region-name="xsl-region-before-even"
    10131748                          extent="{$region.before.extent}"
     1749                          precedence="{$region.before.precedence}"
    10141750                          display-align="before"/>
    10151751        <fo:region-after region-name="xsl-region-after-even"
    10161752                         extent="{$region.after.extent}"
     1753                          precedence="{$region.after.precedence}"
    10171754                         display-align="after"/>
     1755        <xsl:call-template name="region.outer">
     1756          <xsl:with-param name="sequence">even</xsl:with-param>
     1757          <xsl:with-param name="pageclass">body</xsl:with-param>
     1758        </xsl:call-template>
     1759        <xsl:call-template name="region.inner">
     1760          <xsl:with-param name="sequence">even</xsl:with-param>
     1761          <xsl:with-param name="pageclass">body</xsl:with-param>
     1762        </xsl:call-template>
    10181763      </fo:simple-page-master>
    10191764
     
    10231768                             page-height="{$page.height}"
    10241769                             margin-top="{$page.margin.top}"
    1025                              margin-bottom="{$page.margin.bottom}"
    1026                              margin-left="{$margin.left.inner}"
    1027                              margin-right="{$page.margin.outer}">
     1770                             margin-bottom="{$page.margin.bottom}">
     1771        <xsl:attribute name="margin-{$direction.align.start}">
     1772          <xsl:value-of select="$page.margin.inner"/>
     1773          <xsl:if test="$fop.extensions != 0">
     1774            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1775          </xsl:if>
     1776        </xsl:attribute>
     1777        <xsl:attribute name="margin-{$direction.align.end}">
     1778          <xsl:value-of select="$page.margin.outer"/>
     1779        </xsl:attribute>
    10281780        <xsl:if test="$axf.extensions != 0">
    10291781          <xsl:call-template name="axf-page-master-properties">
     
    10351787                        column-gap="{$column.gap.back}"
    10361788                        column-count="{$column.count.back}">
     1789          <xsl:attribute name="margin-{$direction.align.start}">
     1790            <xsl:value-of select="$body.margin.inner"/>
     1791          </xsl:attribute>
     1792          <xsl:attribute name="margin-{$direction.align.end}">
     1793            <xsl:value-of select="$body.margin.outer"/>
     1794          </xsl:attribute>
    10371795          <xsl:if test="$draft.watermark.image != ''">
    10381796            <xsl:attribute name="background-image">
     
    10491807        <fo:region-before region-name="xsl-region-before-first"
    10501808                          extent="{$region.before.extent}"
     1809                          precedence="{$region.before.precedence}"
    10511810                          display-align="before"/>
    10521811        <fo:region-after region-name="xsl-region-after-first"
    10531812                         extent="{$region.after.extent}"
     1813                          precedence="{$region.after.precedence}"
    10541814                         display-align="after"/>
     1815        <xsl:call-template name="region.inner">
     1816          <xsl:with-param name="sequence">first</xsl:with-param>
     1817          <xsl:with-param name="pageclass">back</xsl:with-param>
     1818        </xsl:call-template>
     1819        <xsl:call-template name="region.outer">
     1820          <xsl:with-param name="sequence">first</xsl:with-param>
     1821          <xsl:with-param name="pageclass">back</xsl:with-param>
     1822        </xsl:call-template>
    10551823      </fo:simple-page-master>
    10561824
     
    10591827                             page-height="{$page.height}"
    10601828                             margin-top="{$page.margin.top}"
    1061                              margin-bottom="{$page.margin.bottom}"
    1062                              margin-left="{$margin.left.inner}"
    1063                              margin-right="{$page.margin.outer}">
     1829                             margin-bottom="{$page.margin.bottom}">
     1830        <xsl:attribute name="margin-{$direction.align.start}">
     1831          <xsl:value-of select="$page.margin.inner"/>
     1832          <xsl:if test="$fop.extensions != 0">
     1833            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1834          </xsl:if>
     1835        </xsl:attribute>
     1836        <xsl:attribute name="margin-{$direction.align.end}">
     1837          <xsl:value-of select="$page.margin.outer"/>
     1838        </xsl:attribute>
    10641839        <xsl:if test="$axf.extensions != 0">
    10651840          <xsl:call-template name="axf-page-master-properties">
     
    10711846                        column-gap="{$column.gap.back}"
    10721847                        column-count="{$column.count.back}">
     1848          <xsl:attribute name="margin-{$direction.align.start}">
     1849            <xsl:value-of select="$body.margin.inner"/>
     1850          </xsl:attribute>
     1851          <xsl:attribute name="margin-{$direction.align.end}">
     1852            <xsl:value-of select="$body.margin.outer"/>
     1853          </xsl:attribute>
    10731854          <xsl:if test="$draft.watermark.image != ''">
    10741855            <xsl:attribute name="background-image">
     
    10851866        <fo:region-before region-name="xsl-region-before-odd"
    10861867                          extent="{$region.before.extent}"
     1868                          precedence="{$region.before.precedence}"
    10871869                          display-align="before"/>
    10881870        <fo:region-after region-name="xsl-region-after-odd"
    10891871                         extent="{$region.after.extent}"
     1872                          precedence="{$region.after.precedence}"
    10901873                         display-align="after"/>
     1874        <xsl:call-template name="region.inner">
     1875          <xsl:with-param name="sequence">odd</xsl:with-param>
     1876          <xsl:with-param name="pageclass">back</xsl:with-param>
     1877        </xsl:call-template>
     1878        <xsl:call-template name="region.outer">
     1879          <xsl:with-param name="sequence">odd</xsl:with-param>
     1880          <xsl:with-param name="pageclass">back</xsl:with-param>
     1881        </xsl:call-template>
    10911882      </fo:simple-page-master>
    10921883
     
    10951886                             page-height="{$page.height}"
    10961887                             margin-top="{$page.margin.top}"
    1097                              margin-bottom="{$page.margin.bottom}"
    1098                              margin-left="{$margin.left.outer}"
    1099                              margin-right="{$page.margin.inner}">
     1888                             margin-bottom="{$page.margin.bottom}">
     1889        <xsl:attribute name="margin-{$direction.align.start}">
     1890          <xsl:value-of select="$page.margin.outer"/>
     1891          <xsl:if test="$fop.extensions != 0">
     1892            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1893          </xsl:if>
     1894        </xsl:attribute>
     1895        <xsl:attribute name="margin-{$direction.align.end}">
     1896          <xsl:value-of select="$page.margin.inner"/>
     1897        </xsl:attribute>
    11001898        <xsl:if test="$axf.extensions != 0">
    11011899          <xsl:call-template name="axf-page-master-properties">
     
    11071905                        column-gap="{$column.gap.back}"
    11081906                        column-count="{$column.count.back}">
     1907          <xsl:attribute name="margin-{$direction.align.start}">
     1908            <xsl:value-of select="$body.margin.outer"/>
     1909          </xsl:attribute>
     1910          <xsl:attribute name="margin-{$direction.align.end}">
     1911            <xsl:value-of select="$body.margin.inner"/>
     1912          </xsl:attribute>
    11091913          <xsl:if test="$draft.watermark.image != ''">
    11101914            <xsl:attribute name="background-image">
     
    11211925        <fo:region-before region-name="xsl-region-before-even"
    11221926                          extent="{$region.before.extent}"
     1927                          precedence="{$region.before.precedence}"
    11231928                          display-align="before"/>
    11241929        <fo:region-after region-name="xsl-region-after-even"
    11251930                         extent="{$region.after.extent}"
     1931                          precedence="{$region.after.precedence}"
    11261932                         display-align="after"/>
     1933        <xsl:call-template name="region.outer">
     1934          <xsl:with-param name="sequence">even</xsl:with-param>
     1935          <xsl:with-param name="pageclass">back</xsl:with-param>
     1936        </xsl:call-template>
     1937        <xsl:call-template name="region.inner">
     1938          <xsl:with-param name="sequence">even</xsl:with-param>
     1939          <xsl:with-param name="pageclass">back</xsl:with-param>
     1940        </xsl:call-template>
    11271941      </fo:simple-page-master>
    11281942
     
    11321946                             page-height="{$page.height}"
    11331947                             margin-top="{$page.margin.top}"
    1134                              margin-bottom="{$page.margin.bottom}"
    1135                              margin-left="{$page.margin.inner}"
    1136                              margin-right="{$page.margin.outer}">
     1948                             margin-bottom="{$page.margin.bottom}">
     1949        <xsl:attribute name="margin-{$direction.align.start}">
     1950          <xsl:value-of select="$page.margin.inner"/>
     1951          <xsl:if test="$fop.extensions != 0">
     1952            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     1953          </xsl:if>
     1954        </xsl:attribute>
     1955        <xsl:attribute name="margin-{$direction.align.end}">
     1956          <xsl:value-of select="$page.margin.outer"/>
     1957        </xsl:attribute>
    11371958        <xsl:if test="$axf.extensions != 0">
    11381959          <xsl:call-template name="axf-page-master-properties">
     
    11441965                        column-gap="{$column.gap.index}"
    11451966                        column-count="{$column.count.index}">
     1967          <xsl:attribute name="margin-{$direction.align.start}">
     1968            <xsl:value-of select="$body.margin.inner"/>
     1969          </xsl:attribute>
     1970          <xsl:attribute name="margin-{$direction.align.end}">
     1971            <xsl:value-of select="$body.margin.outer"/>
     1972          </xsl:attribute>
    11461973          <xsl:if test="$draft.watermark.image != ''">
    11471974            <xsl:attribute name="background-image">
     
    11581985        <fo:region-before region-name="xsl-region-before-first"
    11591986                          extent="{$region.before.extent}"
     1987                          precedence="{$region.before.precedence}"
    11601988                          display-align="before"/>
    11611989        <fo:region-after region-name="xsl-region-after-first"
    11621990                         extent="{$region.after.extent}"
     1991                          precedence="{$region.after.precedence}"
    11631992                         display-align="after"/>
     1993        <xsl:call-template name="region.inner">
     1994          <xsl:with-param name="sequence">first</xsl:with-param>
     1995          <xsl:with-param name="pageclass">index</xsl:with-param>
     1996        </xsl:call-template>
     1997        <xsl:call-template name="region.outer">
     1998          <xsl:with-param name="sequence">first</xsl:with-param>
     1999          <xsl:with-param name="pageclass">index</xsl:with-param>
     2000        </xsl:call-template>
    11642001      </fo:simple-page-master>
    11652002
     
    11682005                             page-height="{$page.height}"
    11692006                             margin-top="{$page.margin.top}"
    1170                              margin-bottom="{$page.margin.bottom}"
    1171                              margin-left="{$page.margin.inner}"
    1172                              margin-right="{$page.margin.outer}">
     2007                             margin-bottom="{$page.margin.bottom}">
     2008        <xsl:attribute name="margin-{$direction.align.start}">
     2009          <xsl:value-of select="$page.margin.inner"/>
     2010          <xsl:if test="$fop.extensions != 0">
     2011            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     2012          </xsl:if>
     2013        </xsl:attribute>
     2014        <xsl:attribute name="margin-{$direction.align.end}">
     2015          <xsl:value-of select="$page.margin.outer"/>
     2016        </xsl:attribute>
    11732017        <xsl:if test="$axf.extensions != 0">
    11742018          <xsl:call-template name="axf-page-master-properties">
     
    11802024                        column-gap="{$column.gap.index}"
    11812025                        column-count="{$column.count.index}">
     2026          <xsl:attribute name="margin-{$direction.align.start}">
     2027            <xsl:value-of select="$body.margin.inner"/>
     2028          </xsl:attribute>
     2029          <xsl:attribute name="margin-{$direction.align.end}">
     2030            <xsl:value-of select="$body.margin.outer"/>
     2031          </xsl:attribute>
    11822032          <xsl:if test="$draft.watermark.image != ''">
    11832033            <xsl:attribute name="background-image">
     
    11942044        <fo:region-before region-name="xsl-region-before-odd"
    11952045                          extent="{$region.before.extent}"
     2046                          precedence="{$region.before.precedence}"
    11962047                          display-align="before"/>
    11972048        <fo:region-after region-name="xsl-region-after-odd"
    11982049                         extent="{$region.after.extent}"
     2050                          precedence="{$region.after.precedence}"
    11992051                         display-align="after"/>
     2052        <xsl:call-template name="region.inner">
     2053          <xsl:with-param name="sequence">odd</xsl:with-param>
     2054          <xsl:with-param name="pageclass">index</xsl:with-param>
     2055        </xsl:call-template>
     2056        <xsl:call-template name="region.outer">
     2057          <xsl:with-param name="sequence">odd</xsl:with-param>
     2058          <xsl:with-param name="pageclass">index</xsl:with-param>
     2059        </xsl:call-template>
    12002060      </fo:simple-page-master>
    12012061
     
    12042064                             page-height="{$page.height}"
    12052065                             margin-top="{$page.margin.top}"
    1206                              margin-bottom="{$page.margin.bottom}"
    1207                              margin-right="{$page.margin.inner}"
    1208                              margin-left="{$page.margin.outer}">
     2066                             margin-bottom="{$page.margin.bottom}">
     2067        <xsl:attribute name="margin-{$direction.align.start}">
     2068          <xsl:value-of select="$page.margin.outer"/>
     2069          <xsl:if test="$fop.extensions != 0">
     2070            <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
     2071          </xsl:if>
     2072        </xsl:attribute>
     2073        <xsl:attribute name="margin-{$direction.align.end}">
     2074          <xsl:value-of select="$page.margin.inner"/>
     2075        </xsl:attribute>
    12092076        <xsl:if test="$axf.extensions != 0">
    12102077          <xsl:call-template name="axf-page-master-properties">
     
    12162083                        column-gap="{$column.gap.index}"
    12172084                        column-count="{$column.count.index}">
     2085          <xsl:attribute name="margin-{$direction.align.start}">
     2086            <xsl:value-of select="$body.margin.outer"/>
     2087          </xsl:attribute>
     2088          <xsl:attribute name="margin-{$direction.align.end}">
     2089            <xsl:value-of select="$body.margin.inner"/>
     2090          </xsl:attribute>
    12182091          <xsl:if test="$draft.watermark.image != ''">
    12192092            <xsl:attribute name="background-image">
     
    12302103        <fo:region-before region-name="xsl-region-before-even"
    12312104                          extent="{$region.before.extent}"
     2105                          precedence="{$region.before.precedence}"
    12322106                          display-align="before"/>
    12332107        <fo:region-after region-name="xsl-region-after-even"
    12342108                         extent="{$region.after.extent}"
     2109                          precedence="{$region.after.precedence}"
    12352110                         display-align="after"/>
     2111        <xsl:call-template name="region.outer">
     2112          <xsl:with-param name="sequence">even</xsl:with-param>
     2113          <xsl:with-param name="pageclass">index</xsl:with-param>
     2114        </xsl:call-template>
     2115        <xsl:call-template name="region.inner">
     2116          <xsl:with-param name="sequence">even</xsl:with-param>
     2117          <xsl:with-param name="pageclass">index</xsl:with-param>
     2118        </xsl:call-template>
    12362119      </fo:simple-page-master>
    12372120    </xsl:if>
     
    12422125        <fo:conditional-page-master-reference master-reference="blank"
    12432126                                              blank-or-not-blank="blank"/>
    1244         <fo:conditional-page-master-reference master-reference="titlepage-first"
    1245                                               page-position="first"/>
     2127        <xsl:if test="$force.blank.pages != 0">
     2128          <fo:conditional-page-master-reference master-reference="titlepage-first"
     2129                                                page-position="first"/>
     2130        </xsl:if>
    12462131        <fo:conditional-page-master-reference master-reference="titlepage-odd"
    12472132                                              odd-or-even="odd"/>
     
    12632148        <fo:conditional-page-master-reference master-reference="blank"
    12642149                                              blank-or-not-blank="blank"/>
    1265         <fo:conditional-page-master-reference master-reference="lot-first"
    1266                                               page-position="first"/>
     2150        <xsl:if test="$force.blank.pages != 0">
     2151          <fo:conditional-page-master-reference master-reference="lot-first"
     2152                                                page-position="first"/>
     2153        </xsl:if>
    12672154        <fo:conditional-page-master-reference master-reference="lot-odd"
    12682155                                              odd-or-even="odd"/>
     
    12842171        <fo:conditional-page-master-reference master-reference="blank"
    12852172                                              blank-or-not-blank="blank"/>
    1286         <fo:conditional-page-master-reference master-reference="front-first"
    1287                                               page-position="first"/>
     2173        <xsl:if test="$force.blank.pages != 0">
     2174          <fo:conditional-page-master-reference master-reference="front-first"
     2175                                                page-position="first"/>
     2176        </xsl:if>
    12882177        <fo:conditional-page-master-reference master-reference="front-odd"
    12892178                                              odd-or-even="odd"/>
     
    13052194        <fo:conditional-page-master-reference master-reference="blank"
    13062195                                              blank-or-not-blank="blank"/>
    1307         <fo:conditional-page-master-reference master-reference="body-first"
    1308                                               page-position="first"/>
     2196        <xsl:if test="$force.blank.pages != 0">
     2197          <fo:conditional-page-master-reference master-reference="body-first"
     2198                                                page-position="first"/>
     2199        </xsl:if>
    13092200        <fo:conditional-page-master-reference master-reference="body-odd"
    13102201                                              odd-or-even="odd"/>
     
    13262217        <fo:conditional-page-master-reference master-reference="blank"
    13272218                                              blank-or-not-blank="blank"/>
    1328         <fo:conditional-page-master-reference master-reference="back-first"
    1329                                               page-position="first"/>
     2219        <xsl:if test="$force.blank.pages != 0">
     2220          <fo:conditional-page-master-reference master-reference="back-first"
     2221                                                page-position="first"/>
     2222        </xsl:if>
    13302223        <fo:conditional-page-master-reference master-reference="back-odd"
    13312224                                              odd-or-even="odd"/>
     
    13472240        <fo:conditional-page-master-reference master-reference="blank"
    13482241                                              blank-or-not-blank="blank"/>
    1349         <fo:conditional-page-master-reference master-reference="index-first"
    1350                                               page-position="first"/>
     2242        <xsl:if test="$force.blank.pages != 0">
     2243          <fo:conditional-page-master-reference master-reference="index-first"
     2244                                                page-position="first"/>
     2245        </xsl:if>
    13512246        <fo:conditional-page-master-reference master-reference="index-odd"
    13522247                                              odd-or-even="odd"/>
     
    13692264          <fo:conditional-page-master-reference master-reference="blank-draft"
    13702265                                                blank-or-not-blank="blank"/>
    1371           <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
    1372                                                 page-position="first"/>
     2266          <xsl:if test="$force.blank.pages != 0">
     2267            <fo:conditional-page-master-reference master-reference="titlepage-first-draft"
     2268                                                  page-position="first"/>
     2269          </xsl:if>
    13732270          <fo:conditional-page-master-reference master-reference="titlepage-odd-draft"
    13742271                                                odd-or-even="odd"/>
     
    13902287          <fo:conditional-page-master-reference master-reference="blank-draft"
    13912288                                                blank-or-not-blank="blank"/>
    1392           <fo:conditional-page-master-reference master-reference="lot-first-draft"
    1393                                                 page-position="first"/>
     2289          <xsl:if test="$force.blank.pages != 0">
     2290            <fo:conditional-page-master-reference master-reference="lot-first-draft"
     2291                                                  page-position="first"/>
     2292          </xsl:if>
    13942293          <fo:conditional-page-master-reference master-reference="lot-odd-draft"
    13952294                                                odd-or-even="odd"/>
     
    14112310          <fo:conditional-page-master-reference master-reference="blank-draft"
    14122311                                                blank-or-not-blank="blank"/>
    1413           <fo:conditional-page-master-reference master-reference="front-first-draft"
    1414                                                 page-position="first"/>
     2312          <xsl:if test="$force.blank.pages != 0">
     2313            <fo:conditional-page-master-reference master-reference="front-first-draft"
     2314                                                  page-position="first"/>
     2315          </xsl:if>
    14152316          <fo:conditional-page-master-reference master-reference="front-odd-draft"
    14162317                                                odd-or-even="odd"/>
     
    14322333          <fo:conditional-page-master-reference master-reference="blank-draft"
    14332334                                                blank-or-not-blank="blank"/>
    1434           <fo:conditional-page-master-reference master-reference="body-first-draft"
    1435                                                 page-position="first"/>
     2335          <xsl:if test="$force.blank.pages != 0">
     2336            <fo:conditional-page-master-reference master-reference="body-first-draft"
     2337                                                  page-position="first"/>
     2338          </xsl:if>
    14362339          <fo:conditional-page-master-reference master-reference="body-odd-draft"
    14372340                                                odd-or-even="odd"/>
     
    14532356          <fo:conditional-page-master-reference master-reference="blank-draft"
    14542357                                                blank-or-not-blank="blank"/>
    1455           <fo:conditional-page-master-reference master-reference="back-first-draft"
    1456                                                 page-position="first"/>
     2358          <xsl:if test="$force.blank.pages != 0">
     2359            <fo:conditional-page-master-reference master-reference="back-first-draft"
     2360                                                  page-position="first"/>
     2361          </xsl:if>
    14572362          <fo:conditional-page-master-reference master-reference="back-odd-draft"
    14582363                                                odd-or-even="odd"/>
     
    14742379          <fo:conditional-page-master-reference master-reference="blank-draft"
    14752380                                                blank-or-not-blank="blank"/>
    1476           <fo:conditional-page-master-reference master-reference="index-first-draft"
    1477                                                 page-position="first"/>
     2381          <xsl:if test="$force.blank.pages != 0">
     2382            <fo:conditional-page-master-reference master-reference="index-first-draft"
     2383                                                  page-position="first"/>
     2384          </xsl:if>
    14782385          <fo:conditional-page-master-reference master-reference="index-odd-draft"
    14792386                                                odd-or-even="odd"/>
     
    15132420      <xsl:when test="$pageclass = 'lot'">lot</xsl:when>
    15142421      <xsl:when test="$element = 'dedication'">front</xsl:when>
     2422      <xsl:when test="$element = 'acknowledgements'">front</xsl:when>
    15152423      <xsl:when test="$element = 'preface'">front</xsl:when>
    15162424      <xsl:when test="$element = 'appendix'">back</xsl:when>
     
    16442552    <xsl:call-template name="blank.page.content"/>
    16452553  </xsl:if>
     2554
     2555  <xsl:apply-templates select="." mode="region.inner.mode">
     2556    <xsl:with-param name="master-reference" select="$master-reference"/>
     2557    <xsl:with-param name="gentext-key" select="$gentext-key"/>
     2558  </xsl:apply-templates>
     2559
     2560  <xsl:apply-templates select="." mode="region.outer.mode">
     2561    <xsl:with-param name="master-reference" select="$master-reference"/>
     2562    <xsl:with-param name="gentext-key" select="$gentext-key"/>
     2563  </xsl:apply-templates>
     2564
    16462565</xsl:template>
    16472566
     
    16602579</xsl:template>
    16612580
     2581<xsl:template name="running.side.content">
     2582  <xsl:apply-templates select="." mode="region.inner.mode"/>
     2583</xsl:template>
     2584
    16622585<xsl:template name="header.table">
    16632586  <xsl:param name="pageclass" select="''"/>
     
    16702593  <xsl:choose>
    16712594      <xsl:when test="$pageclass = 'index'">
    1672           <xsl:attribute name="margin-left">0pt</xsl:attribute>
     2595          <xsl:attribute name="margin-{$direction.align.start}">0pt</xsl:attribute>
    16732596      </xsl:when>
    16742597  </xsl:choose>
     
    17042627            <xsl:with-param name="location">header</xsl:with-param>
    17052628            <xsl:with-param name="position" select="$column1"/>
     2629            <xsl:with-param name="pageclass" select="$pageclass"/>
     2630            <xsl:with-param name="sequence" select="$sequence"/>
     2631            <xsl:with-param name="gentext-key" select="$gentext-key"/>
    17062632          </xsl:call-template>
    17072633          <xsl:text>)</xsl:text>
     
    17142640            <xsl:with-param name="location">header</xsl:with-param>
    17152641            <xsl:with-param name="position" select="2"/>
     2642            <xsl:with-param name="pageclass" select="$pageclass"/>
     2643            <xsl:with-param name="sequence" select="$sequence"/>
     2644            <xsl:with-param name="gentext-key" select="$gentext-key"/>
    17162645          </xsl:call-template>
    17172646          <xsl:text>)</xsl:text>
     
    17242653            <xsl:with-param name="location">header</xsl:with-param>
    17252654            <xsl:with-param name="position" select="$column3"/>
     2655            <xsl:with-param name="pageclass" select="$pageclass"/>
     2656            <xsl:with-param name="sequence" select="$sequence"/>
     2657            <xsl:with-param name="gentext-key" select="$gentext-key"/>
    17262658          </xsl:call-template>
    17272659          <xsl:text>)</xsl:text>
     
    17342666            <xsl:value-of select="$header.table.height"/>
    17352667          </xsl:attribute>
    1736           <fo:table-cell text-align="left"
     2668          <fo:table-cell text-align="start"
    17372669                         display-align="before">
    17382670            <xsl:if test="$fop.extensions = 0">
     
    17432675                <xsl:with-param name="pageclass" select="$pageclass"/>
    17442676                <xsl:with-param name="sequence" select="$sequence"/>
    1745                 <xsl:with-param name="position" select="'left'"/>
     2677                <xsl:with-param name="position" select="$direction.align.start"/>
    17462678                <xsl:with-param name="gentext-key" select="$gentext-key"/>
    17472679              </xsl:call-template>
     
    17712703                <xsl:with-param name="pageclass" select="$pageclass"/>
    17722704                <xsl:with-param name="sequence" select="$sequence"/>
    1773                 <xsl:with-param name="position" select="'right'"/>
     2705                <xsl:with-param name="position" select="$direction.align.end"/>
    17742706                <xsl:with-param name="gentext-key" select="$gentext-key"/>
    17752707              </xsl:call-template>
     
    18662798  <xsl:param name="location" select="'header'"/>
    18672799  <xsl:param name="position" select="1"/>
     2800  <xsl:param name="pageclass" select="''"/>
     2801  <xsl:param name="sequence" select="''"/>
     2802  <xsl:param name="gentext-key" select="''"/>
     2803
     2804  <!-- The location param is either 'header' or 'footer'.
     2805       The position param is one of '1', '2', or '3' to indicate
     2806       which column of the header or footer table. -->
     2807       
     2808  <!-- The pageclass, sequence, and gentext-key values are passed
     2809       from the header.table or footer.table template.  They are
     2810       not currently used, but are made available here
     2811       for customization of this template. -->
    18682812
    18692813  <xsl:variable name="width.set">
     
    19952939  <xsl:choose>
    19962940      <xsl:when test="$pageclass = 'index'">
    1997           <xsl:attribute name="margin-left">0pt</xsl:attribute>
     2941          <xsl:attribute name="margin-{$direction.align.start}">0pt</xsl:attribute>
    19982942      </xsl:when>
    19992943  </xsl:choose>
     
    20282972            <xsl:with-param name="location">footer</xsl:with-param>
    20292973            <xsl:with-param name="position" select="$column1"/>
     2974            <xsl:with-param name="pageclass" select="$pageclass"/>
     2975            <xsl:with-param name="sequence" select="$sequence"/>
     2976            <xsl:with-param name="gentext-key" select="$gentext-key"/>
    20302977          </xsl:call-template>
    20312978          <xsl:text>)</xsl:text>
     
    20382985            <xsl:with-param name="location">footer</xsl:with-param>
    20392986            <xsl:with-param name="position" select="2"/>
     2987            <xsl:with-param name="pageclass" select="$pageclass"/>
     2988            <xsl:with-param name="sequence" select="$sequence"/>
     2989            <xsl:with-param name="gentext-key" select="$gentext-key"/>
    20402990          </xsl:call-template>
    20412991          <xsl:text>)</xsl:text>
     
    20482998            <xsl:with-param name="location">footer</xsl:with-param>
    20492999            <xsl:with-param name="position" select="$column3"/>
     3000            <xsl:with-param name="pageclass" select="$pageclass"/>
     3001            <xsl:with-param name="sequence" select="$sequence"/>
     3002            <xsl:with-param name="gentext-key" select="$gentext-key"/>
    20503003          </xsl:call-template>
    20513004          <xsl:text>)</xsl:text>
     
    20583011            <xsl:value-of select="$footer.table.height"/>
    20593012          </xsl:attribute>
    2060           <fo:table-cell text-align="left"
     3013          <fo:table-cell text-align="start"
    20613014                         display-align="after">
    20623015            <xsl:if test="$fop.extensions = 0">
     
    20673020                <xsl:with-param name="pageclass" select="$pageclass"/>
    20683021                <xsl:with-param name="sequence" select="$sequence"/>
    2069                 <xsl:with-param name="position" select="'left'"/>
     3022                <xsl:with-param name="position" select="$direction.align.start"/>
    20703023                <xsl:with-param name="gentext-key" select="$gentext-key"/>
    20713024              </xsl:call-template>
     
    20863039            </fo:block>
    20873040          </fo:table-cell>
    2088           <fo:table-cell text-align="right"
     3041          <fo:table-cell text-align="end"
    20893042                         display-align="after">
    20903043            <xsl:if test="$fop.extensions = 0">
     
    20953048                <xsl:with-param name="pageclass" select="$pageclass"/>
    20963049                <xsl:with-param name="sequence" select="$sequence"/>
    2097                 <xsl:with-param name="position" select="'right'"/>
     3050                <xsl:with-param name="position" select="$direction.align.end"/>
    20983051                <xsl:with-param name="gentext-key" select="$gentext-key"/>
    20993052              </xsl:call-template>
     
    21843137
    21853138<!-- ==================================================================== -->
     3139<xsl:template match="*" mode="region.inner.mode">
     3140  <xsl:param name="master-reference" select="'unknown'"/>
     3141  <xsl:param name="gentext-key" select="local-name(.)"/>
     3142
     3143  <!-- remove -draft from reference -->
     3144  <xsl:variable name="pageclass">
     3145    <xsl:choose>
     3146      <xsl:when test="contains($master-reference, '-draft')">
     3147        <xsl:value-of select="substring-before($master-reference, '-draft')"/>
     3148      </xsl:when>
     3149      <xsl:otherwise>
     3150        <xsl:value-of select="$master-reference"/>
     3151      </xsl:otherwise>
     3152    </xsl:choose>
     3153  </xsl:variable>
     3154
     3155  <fo:static-content flow-name="xsl-region-inner-first">
     3156    <xsl:call-template name="inner.region.content">
     3157      <xsl:with-param name="pageclass" select="$pageclass"/>
     3158      <xsl:with-param name="sequence" select="'first'"/>
     3159      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3160    </xsl:call-template>
     3161  </fo:static-content>
     3162
     3163  <fo:static-content flow-name="xsl-region-inner-odd">
     3164    <xsl:call-template name="inner.region.content">
     3165      <xsl:with-param name="pageclass" select="$pageclass"/>
     3166      <xsl:with-param name="sequence" select="'odd'"/>
     3167      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3168    </xsl:call-template>
     3169  </fo:static-content>
     3170
     3171  <fo:static-content flow-name="xsl-region-inner-even">
     3172    <xsl:call-template name="inner.region.content">
     3173      <xsl:with-param name="pageclass" select="$pageclass"/>
     3174      <xsl:with-param name="sequence" select="'even'"/>
     3175      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3176    </xsl:call-template>
     3177  </fo:static-content>
     3178
     3179  <fo:static-content flow-name="xsl-region-inner-blank">
     3180    <xsl:call-template name="inner.region.content">
     3181      <xsl:with-param name="pageclass" select="$pageclass"/>
     3182      <xsl:with-param name="sequence" select="'blank'"/>
     3183      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3184    </xsl:call-template>
     3185  </fo:static-content>
     3186
     3187</xsl:template>
     3188
     3189<xsl:template match="*" mode="region.outer.mode">
     3190  <xsl:param name="master-reference" select="'unknown'"/>
     3191  <xsl:param name="gentext-key" select="local-name(.)"/>
     3192
     3193  <!-- remove -draft from reference -->
     3194  <xsl:variable name="pageclass">
     3195    <xsl:choose>
     3196      <xsl:when test="contains($master-reference, '-draft')">
     3197        <xsl:value-of select="substring-before($master-reference, '-draft')"/>
     3198      </xsl:when>
     3199      <xsl:otherwise>
     3200        <xsl:value-of select="$master-reference"/>
     3201      </xsl:otherwise>
     3202    </xsl:choose>
     3203  </xsl:variable>
     3204
     3205  <fo:static-content flow-name="xsl-region-outer-first">
     3206    <xsl:call-template name="outer.region.content">
     3207      <xsl:with-param name="pageclass" select="$pageclass"/>
     3208      <xsl:with-param name="sequence" select="'first'"/>
     3209      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3210    </xsl:call-template>
     3211  </fo:static-content>
     3212
     3213  <fo:static-content flow-name="xsl-region-outer-odd">
     3214    <xsl:call-template name="outer.region.content">
     3215      <xsl:with-param name="pageclass" select="$pageclass"/>
     3216      <xsl:with-param name="sequence" select="'odd'"/>
     3217      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3218    </xsl:call-template>
     3219  </fo:static-content>
     3220
     3221  <fo:static-content flow-name="xsl-region-outer-even">
     3222    <xsl:call-template name="outer.region.content">
     3223      <xsl:with-param name="pageclass" select="$pageclass"/>
     3224      <xsl:with-param name="sequence" select="'even'"/>
     3225      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3226    </xsl:call-template>
     3227  </fo:static-content>
     3228
     3229  <fo:static-content flow-name="xsl-region-outer-blank">
     3230    <xsl:call-template name="outer.region.content">
     3231      <xsl:with-param name="pageclass" select="$pageclass"/>
     3232      <xsl:with-param name="sequence" select="'blank'"/>
     3233      <xsl:with-param name="gentext-key" select="$gentext-key"/>
     3234    </xsl:call-template>
     3235  </fo:static-content>
     3236
     3237</xsl:template>
     3238
     3239<xsl:template name="inner.region.content">
     3240  <xsl:param name="pageclass" select="''"/>
     3241  <xsl:param name="sequence" select="''"/>
     3242  <xsl:param name="position" select="''"/>
     3243  <xsl:param name="gentext-key" select="''"/>
     3244
     3245  <!-- pageclass can be front, body, back -->
     3246  <!-- sequence can be odd, even, first, blank -->
     3247  <!-- position can be left, center, right -->
     3248
     3249  <!-- Customize to add side region content-->
     3250  <fo:block xsl:use-attribute-sets="inner.region.content.properties">
     3251    <!-- Add your content here -->
     3252  </fo:block>
     3253</xsl:template>
     3254
     3255<xsl:template name="outer.region.content">
     3256  <xsl:param name="pageclass" select="''"/>
     3257  <xsl:param name="sequence" select="''"/>
     3258  <xsl:param name="position" select="''"/>
     3259  <xsl:param name="gentext-key" select="''"/>
     3260
     3261  <!-- pageclass can be front, body, back -->
     3262  <!-- sequence can be odd, even, first, blank -->
     3263  <!-- position can be left, center, right -->
     3264
     3265  <!-- Customize to add side region content-->
     3266  <fo:block xsl:use-attribute-sets="outer.region.content.properties">
     3267    <!-- Add your content here -->
     3268  </fo:block>
     3269</xsl:template>
     3270
     3271<!-- ==================================================================== -->
    21863272
    21873273<xsl:template name="page.number.format">
     
    21913277  <xsl:choose>
    21923278    <xsl:when test="$element = 'toc' and self::book">i</xsl:when>
     3279    <xsl:when test="$element = 'set'">i</xsl:when>
     3280    <xsl:when test="$element = 'book'">i</xsl:when>
    21933281    <xsl:when test="$element = 'preface'">i</xsl:when>
    21943282    <xsl:when test="$element = 'dedication'">i</xsl:when>
     3283    <xsl:when test="$element = 'acknowledgements'">i</xsl:when>
    21953284    <xsl:otherwise>1</xsl:otherwise>
    21963285  </xsl:choose>
     
    22013290  <xsl:param name="master-reference" select="''"/>
    22023291
     3292  <xsl:variable name="first">
     3293    <xsl:choose>
     3294      <xsl:when test="$force.blank.pages = 0">auto</xsl:when>
     3295      <xsl:otherwise>auto-odd</xsl:otherwise>
     3296    </xsl:choose>
     3297  </xsl:variable>
    22033298  <!-- Select the first content that the stylesheet places
    22043299       after the TOC -->
     
    22113306                              self::info or
    22123307                              self::dedication or
     3308                              self::acknowledgements or
    22133309                              self::preface or
    22143310                              self::toc or
     
    22183314    <xsl:when test="$double.sided != 0">
    22193315      <xsl:choose>
    2220         <xsl:when test="$element = 'toc'">auto-odd</xsl:when>
    2221         <xsl:when test="$element = 'book'">1</xsl:when>
     3316        <xsl:when test="$element = 'toc'"><xsl:value-of select="$first"/></xsl:when>
     3317        <xsl:when test="$element = 'book'"><xsl:value-of select="$first"/></xsl:when>
    22223318        <!-- preface typically continues TOC roman numerals -->
    2223         <!-- Change page.number.format if not -->
    2224         <xsl:when test="$element = 'preface'">auto-odd</xsl:when>
     3319        <!-- If changed to 1 here, then change page.number.format too -->
     3320        <xsl:when test="$element = 'preface'"><xsl:value-of select="$first"/></xsl:when>
    22253321        <xsl:when test="($element = 'dedication' or $element = 'article')
    22263322                    and not(preceding::chapter
     
    22333329        <xsl:when test="generate-id($first.book.content) =
    22343330                        generate-id(.)">1</xsl:when>
    2235         <xsl:otherwise>auto-odd</xsl:otherwise>
     3331        <xsl:otherwise><xsl:value-of select="$first"/></xsl:otherwise>
    22363332      </xsl:choose>
    22373333    </xsl:when>
     
    22413337      <xsl:choose>
    22423338        <xsl:when test="$element = 'toc'">auto</xsl:when>
    2243         <xsl:when test="$element = 'book'">1</xsl:when>
     3339        <xsl:when test="$element = 'book'">auto</xsl:when>
    22443340        <xsl:when test="$element = 'preface'">auto</xsl:when>
    22453341       <xsl:when test="($element = 'dedication' or $element = 'article') and
     
    22643360
    22653361  <xsl:choose>
     3362    <!-- no automatic even blank pages at end of chapters -->
     3363    <xsl:when test="$force.blank.pages = 0">no-force</xsl:when>
    22663364    <!-- double-sided output -->
    22673365    <xsl:when test="$double.sided != 0">end-on-even</xsl:when>
     
    22913389
    22923390  <xsl:choose>
    2293     <xsl:when test="$fop.extensions != 0 or $passivetex.extensions != 0">
     3391    <xsl:when test="$fop.extensions != 0">
    22943392      <!-- body.start.indent does not work well with these processors -->
    22953393    </xsl:when>
     
    23123410<!-- ==================================================================== -->
    23133411
     3412<!-- Customize this template for custom side regions -->
     3413<xsl:template name="region.inner">
     3414  <xsl:param name="sequence">blank</xsl:param>
     3415  <xsl:param name="classname">blank</xsl:param>
     3416
     3417  <xsl:choose>
     3418    <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
     3419      <fo:region-start xsl:use-attribute-sets="region.inner.properties">
     3420        <xsl:attribute name="region-name">
     3421          <xsl:text>xsl-region-inner-</xsl:text>
     3422          <xsl:value-of select="$sequence"/>
     3423        </xsl:attribute>
     3424        <xsl:attribute name="precedence">
     3425          <xsl:value-of select="$region.start.precedence"/>
     3426        </xsl:attribute>
     3427        <xsl:attribute name="extent">
     3428          <xsl:value-of select="$region.inner.extent"/>
     3429        </xsl:attribute>
     3430      </fo:region-start>
     3431    </xsl:when>
     3432    <xsl:otherwise>
     3433      <fo:region-end xsl:use-attribute-sets="region.inner.properties">
     3434        <xsl:attribute name="region-name">
     3435          <xsl:text>xsl-region-inner-</xsl:text>
     3436          <xsl:value-of select="$sequence"/>
     3437        </xsl:attribute>
     3438        <xsl:attribute name="precedence">
     3439          <xsl:value-of select="$region.end.precedence"/>
     3440        </xsl:attribute>
     3441        <xsl:attribute name="extent">
     3442          <xsl:value-of select="$region.inner.extent"/>
     3443        </xsl:attribute>
     3444      </fo:region-end>
     3445    </xsl:otherwise>
     3446  </xsl:choose>
     3447</xsl:template>
     3448
     3449<!-- Customize this template for custom side regions -->
     3450<xsl:template name="region.outer">
     3451  <xsl:param name="sequence">blank</xsl:param>
     3452  <xsl:param name="classname">blank</xsl:param>
     3453
     3454  <xsl:choose>
     3455    <xsl:when test="$sequence = 'first' or $sequence = 'odd'">
     3456      <fo:region-end xsl:use-attribute-sets="region.outer.properties">
     3457        <xsl:attribute name="region-name">
     3458          <xsl:text>xsl-region-outer-</xsl:text>
     3459          <xsl:value-of select="$sequence"/>
     3460        </xsl:attribute>
     3461        <xsl:attribute name="precedence">
     3462          <xsl:value-of select="$region.start.precedence"/>
     3463        </xsl:attribute>
     3464        <xsl:attribute name="extent">
     3465          <xsl:value-of select="$region.outer.extent"/>
     3466        </xsl:attribute>
     3467      </fo:region-end>
     3468    </xsl:when>
     3469    <xsl:otherwise>
     3470      <fo:region-start xsl:use-attribute-sets="region.outer.properties">
     3471        <xsl:attribute name="region-name">
     3472          <xsl:text>xsl-region-outer-</xsl:text>
     3473          <xsl:value-of select="$sequence"/>
     3474        </xsl:attribute>
     3475        <xsl:attribute name="precedence">
     3476          <xsl:value-of select="$region.end.precedence"/>
     3477        </xsl:attribute>
     3478        <xsl:attribute name="extent">
     3479          <xsl:value-of select="$region.outer.extent"/>
     3480        </xsl:attribute>
     3481      </fo:region-start>
     3482    </xsl:otherwise>
     3483  </xsl:choose>
     3484</xsl:template>
     3485
    23143486</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.