]> granicus.if.org Git - docbook-dsssl/commitdiff
Add support for writing-mode="rl-tb" (right-to-left) in FO outputs.
authorBob Stayton <bobs@sagehill.net>
Fri, 6 Mar 2009 22:53:04 +0000 (22:53 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 6 Mar 2009 22:53:04 +0000 (22:53 +0000)
Changed instances of margin-left to margin-{$direction.align.start}
and margin-right to margin-{$direction.align.end}. Those direction.align
params are computed from the writing mode value in each locale's
gentext key named 'writing-mode', introduced in 1.74.3 to add
right-to-left support to HTML outputs.

xsl/fo/autotoc.xsl
xsl/fo/fo.xsl
xsl/fo/glossary.xsl
xsl/fo/lists.xsl
xsl/fo/pagesetup.xsl
xsl/fo/table.xsl

index 4d23db2972e02b34c522cffdeaad5332d5f7949e..2c9c83c5a14c2de7cb95198eddb89b424edd8c46 100644 (file)
 
   <xsl:if test="$nodes">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
 
   </xsl:variable>
 
   <fo:block xsl:use-attribute-sets="toc.line.properties"
-           margin-left="3em"
-           text-indent="-3em"
             end-indent="{$toc.indent.width}pt"
             last-line-end-indent="-{$toc.indent.width}pt">
+    <xsl:attribute name="margin-{$direction.align.start}">3em</xsl:attribute>
+    <xsl:attribute name="text-indent">-3em</xsl:attribute>
     <fo:inline keep-with-next.within-line="always">
       <fo:basic-link internal-destination="{$id}">
         <xsl:if test="$label != ''">
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
 
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
       
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
       
                 and $toc.max.depth > $depth.from.context
                 and refentry">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
               
                 and $toc.max.depth > $depth.from.context
                 and $nodes">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
               
                 and $toc.max.depth > $depth.from.context
                 and sect2">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent"/>
       </xsl:attribute>
               
                 and $toc.max.depth > $depth.from.context
                 and sect3">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent">
           <xsl:with-param name="reldepth" select="$reldepth"/>
         </xsl:call-template>
                 and $toc.max.depth > $depth.from.context
                 and sect4">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent">
           <xsl:with-param name="reldepth" select="$reldepth"/>
         </xsl:call-template>
                 and $toc.max.depth > $depth.from.context
                 and sect5">
     <fo:block id="toc.{$cid}.{$id}">
-      <xsl:attribute name="margin-left">
+      <xsl:attribute name="margin-{$direction.align.start}">
         <xsl:call-template name="set.toc.indent">
           <xsl:with-param name="reldepth" select="$reldepth"/>
         </xsl:call-template>
                   and $toc.max.depth > $depth.from.context
                   and section">
       <fo:block id="toc.{$cid}.{$id}">
-        <xsl:attribute name="margin-left">
+        <xsl:attribute name="margin-{$direction.align.start}">
           <xsl:call-template name="set.toc.indent">
             <xsl:with-param name="reldepth" select="$reldepth"/>
           </xsl:call-template>
                   and $toc.max.depth > $depth.from.context
                   and (child::qandadiv or child::qandaentry)">
       <fo:block id="toc.{$cid}.{$id}">
-        <xsl:attribute name="margin-left">
+        <xsl:attribute name="margin-{$direction.align.start}">
           <xsl:call-template name="set.toc.indent">
             <xsl:with-param name="reldepth" select="$reldepth"/>
           </xsl:call-template>
index e1441c742663116f029d7daf52a369e93343fc0f..69f8668de45382621b7c05d1dea96fb526d678e8 100644 (file)
 
      ******************************************************************** -->
 
+<!-- These variables set the margin-left or -right attribute value for FO output based on
+     the writing-mode specified in the gentext file for the document's lang. -->
+
+<xsl:param name="direction.align.start">
+  <xsl:choose>
+    <!-- FOP does not support writing-mode="rl-tb" -->
+    <xsl:when test="$fop.extensions != 0">left</xsl:when>
+    <xsl:when test="$fop1.extensions != 0">left</xsl:when>
+    <xsl:when test="starts-with($writing.mode, 'lr')">left</xsl:when>
+    <xsl:when test="starts-with($writing.mode, 'rl')">right</xsl:when>
+    <xsl:otherwise>left</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<xsl:param name="direction.align.end">
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0">right</xsl:when>
+    <xsl:when test="$fop1.extensions != 0">right</xsl:when>
+    <xsl:when test="starts-with($writing.mode, 'lr')">right</xsl:when>
+    <xsl:when test="starts-with($writing.mode, 'rl')">left</xsl:when>
+    <xsl:otherwise>right</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+<xsl:param name="direction.mode">
+  <xsl:choose>
+    <xsl:when test="$fop.extensions != 0 and
+                    starts-with($writing.mode, 'rl')">
+      <xsl:message>WARNING: FOP does not support right-to-left writing-mode</xsl:message>
+      <xsl:text>lr-tb</xsl:text>
+    </xsl:when>
+    <xsl:when test="$fop1.extensions != 0 and
+                    starts-with($writing.mode, 'rl')">
+      <xsl:message>WARNING: FOP does not support right-to-left writing-mode</xsl:message>
+      <xsl:text>lr-tb</xsl:text>
+    </xsl:when>
+    <xsl:when test="starts-with($writing.mode, 'lr')">lr-tb</xsl:when>
+    <xsl:when test="starts-with($writing.mode, 'rl')">rl-tb</xsl:when>
+    <xsl:otherwise>lr-tb</xsl:otherwise>
+  </xsl:choose>
+</xsl:param>
+
+
 <xsl:template name="anchor">
   <xsl:param name="node" select="."/>
   <xsl:param name="conditional" select="1"/>
index 7ad78161bf6dd5b17b68f5607d4a71b2f3623023..8fdbc3001c9d761fc17039b4af0d8f7d23c6755a 100644 (file)
@@ -707,7 +707,7 @@ GlossEntry ::=
     <xsl:call-template name="object.id"/>
   </xsl:variable>
 
-  <fo:list-item xsl:use-attribute-sets="normal.para.spacing">
+  <fo:list-item xsl:use-attribute-sets="glossentry.list.item.properties">
     <xsl:call-template name="anchor">
       <xsl:with-param name="conditional">
         <xsl:choose>
@@ -719,7 +719,7 @@ GlossEntry ::=
     </xsl:call-template>
 
     <fo:list-item-label end-indent="label-end()">
-      <fo:block>
+      <fo:block xsl:use-attribute-sets="glossterm.list.properties">
         <xsl:choose>
           <xsl:when test="$glossentry.show.acronym = 'primary'">
             <xsl:choose>
@@ -758,7 +758,9 @@ GlossEntry ::=
     </fo:list-item-label>
 
     <fo:list-item-body start-indent="body-start()">
-      <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.list"/>
+      <fo:block xsl:use-attribute-sets="glossdef.list.properties">
+        <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.list"/>
+      </fo:block>
     </fo:list-item-body>
   </fo:list-item>
 </xsl:template>
@@ -929,9 +931,7 @@ GlossEntry ::=
     <xsl:call-template name="object.id"/>
   </xsl:variable>
 
-  <fo:block xsl:use-attribute-sets="list.item.spacing"
-           keep-with-next.within-column="always" 
-           keep-together.within-column="always">
+  <fo:block xsl:use-attribute-sets="glossterm.block.properties">
     <xsl:call-template name="anchor">
       <xsl:with-param name="conditional">
         <xsl:choose>
@@ -975,7 +975,7 @@ GlossEntry ::=
     <xsl:apply-templates select="indexterm"/>
   </fo:block>
 
-  <fo:block margin-left="0.25in">
+  <fo:block xsl:use-attribute-sets="glossdef.block.properties">
     <xsl:apply-templates select="glosssee|glossdef" mode="glossary.as.blocks"/>
   </fo:block>
 </xsl:template>
index 4a54a74852cfc5849980139926750c409a4084f0..f9cbe545fc8bbd0d5734376d9b7f16e54463ed0e 100644 (file)
     <xsl:apply-templates select="term"/>
   </fo:block>
 
-  <fo:block margin-left="0.25in">
+  <fo:block>
+    <xsl:attribute name="margin-{$direction.align.start}">0.25in</xsl:attribute>
     <xsl:apply-templates select="listitem"/>
   </fo:block>
 </xsl:template>
index 798a93721d4dd5cc33bd96907c2d854caa6d107d..ec93415152aa3c1484d21f25dcf467d8c474bb79 100644 (file)
     <xsl:value-of select="$symbol.font.family"/>
 </xsl:param>
 
-<!-- PassiveTeX can't handle the math expression for
-     title.margin.left being negative, so ignore it.
-     margin-left="{$page.margin.outer} - {$title.margin.left}"
--->
-<xsl:param name="margin.left.outer">
-  <xsl:choose>
-    <xsl:when test="$passivetex.extensions != 0">
-      <xsl:value-of select="$page.margin.outer"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="$page.margin.outer"/>
-      <xsl:text> - </xsl:text>
-      <xsl:value-of select="$title.margin.left"/>
-    </xsl:otherwise>
-  </xsl:choose>
-</xsl:param>
-
 <xsl:param name="margin.left.inner">
   <xsl:choose>
     <xsl:when test="$passivetex.extensions != 0">
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">blank</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">titlepage-first</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">titlepage-odd</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">titlepage-even</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">lot-first</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">lot-odd</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">lot-even</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">front-first</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">front-odd</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">front-even</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">body-first</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">body-odd</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">body-even</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">back-first</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">back-odd</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$margin.left.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">back-even</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$page.margin.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">index-first</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$page.margin.inner}"
-                           margin-right="{$page.margin.outer}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.inner"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.outer"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">index-odd</xsl:with-param>
                            page-width="{$page.width}"
                            page-height="{$page.height}"
                            margin-top="{$page.margin.top}"
-                           margin-bottom="{$page.margin.bottom}"
-                           margin-left="{$page.margin.outer}"
-                           margin-right="{$page.margin.inner}">
+                           margin-bottom="{$page.margin.bottom}">
+      <xsl:attribute name="margin-{$direction.align.start}">
+        <xsl:value-of select="$page.margin.outer"/>
+       <xsl:if test="$fop.extensions != 0">
+         <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+        </xsl:if>
+      </xsl:attribute>
+      <xsl:attribute name="margin-{$direction.align.end}">
+        <xsl:value-of select="$page.margin.inner"/>
+      </xsl:attribute>
       <xsl:if test="$axf.extensions != 0">
         <xsl:call-template name="axf-page-master-properties">
           <xsl:with-param name="page.master">index-even</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.outer}"
-                             margin-right="{$page.margin.inner}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">blank-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">titlepage-first-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">titlepage-odd-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.outer}"
-                             margin-right="{$page.margin.inner}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">titlepage-even-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">lot-first-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">lot-odd-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.outer}"
-                             margin-right="{$page.margin.inner}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">lot-even-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">front-first-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">front-odd-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.outer}"
-                             margin-right="{$page.margin.inner}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">front-even-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">body-first-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">body-odd-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.outer}"
-                             margin-right="{$page.margin.inner}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">body-even-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">back-first-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">back-odd-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$margin.left.outer}"
-                             margin-right="{$page.margin.inner}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">back-even-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$page.margin.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">index-first-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-left="{$page.margin.inner}"
-                             margin-right="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.inner"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.outer"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">index-odd-draft</xsl:with-param>
                              page-width="{$page.width}"
                              page-height="{$page.height}"
                              margin-top="{$page.margin.top}"
-                             margin-bottom="{$page.margin.bottom}"
-                             margin-right="{$page.margin.inner}"
-                             margin-left="{$page.margin.outer}">
+                             margin-bottom="{$page.margin.bottom}">
+        <xsl:attribute name="margin-{$direction.align.start}">
+          <xsl:value-of select="$page.margin.outer"/>
+         <xsl:if test="$fop.extensions != 0">
+           <xsl:value-of select="concat(' - (',$title.margin.left,')')"/>
+          </xsl:if>
+        </xsl:attribute>
+        <xsl:attribute name="margin-{$direction.align.end}">
+          <xsl:value-of select="$page.margin.inner"/>
+        </xsl:attribute>
         <xsl:if test="$axf.extensions != 0">
           <xsl:call-template name="axf-page-master-properties">
             <xsl:with-param name="page.master">index-even-draft</xsl:with-param>
 
   <xsl:choose>
       <xsl:when test="$pageclass = 'index'">
-          <xsl:attribute name="margin-left">0pt</xsl:attribute>
+          <xsl:attribute name="margin-{$direction.align.start}">0pt</xsl:attribute>
       </xsl:when>
   </xsl:choose>
 
           <xsl:attribute name="block-progression-dimension.minimum">
             <xsl:value-of select="$header.table.height"/>
           </xsl:attribute>
-          <fo:table-cell text-align="left"
+          <fo:table-cell text-align="start"
                          display-align="before">
             <xsl:if test="$fop.extensions = 0">
               <xsl:attribute name="relative-align">baseline</xsl:attribute>
               <xsl:call-template name="header.content">
                 <xsl:with-param name="pageclass" select="$pageclass"/>
                 <xsl:with-param name="sequence" select="$sequence"/>
-                <xsl:with-param name="position" select="'left'"/>
+                <xsl:with-param name="position" select="$direction.align.start"/>
                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
               </xsl:call-template>
             </fo:block>
               <xsl:call-template name="header.content">
                 <xsl:with-param name="pageclass" select="$pageclass"/>
                 <xsl:with-param name="sequence" select="$sequence"/>
-                <xsl:with-param name="position" select="'right'"/>
+                <xsl:with-param name="position" select="$direction.align.end"/>
                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
               </xsl:call-template>
             </fo:block>
 
   <xsl:choose>
       <xsl:when test="$pageclass = 'index'">
-          <xsl:attribute name="margin-left">0pt</xsl:attribute>
+          <xsl:attribute name="margin-{$direction.align.start}">0pt</xsl:attribute>
       </xsl:when>
   </xsl:choose>
 
           <xsl:attribute name="block-progression-dimension.minimum">
             <xsl:value-of select="$footer.table.height"/>
           </xsl:attribute>
-          <fo:table-cell text-align="left"
+          <fo:table-cell text-align="start"
                          display-align="after">
             <xsl:if test="$fop.extensions = 0">
               <xsl:attribute name="relative-align">baseline</xsl:attribute>
               <xsl:call-template name="footer.content">
                 <xsl:with-param name="pageclass" select="$pageclass"/>
                 <xsl:with-param name="sequence" select="$sequence"/>
-                <xsl:with-param name="position" select="'left'"/>
+                <xsl:with-param name="position" select="$direction.align.start"/>
                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
               </xsl:call-template>
             </fo:block>
               </xsl:call-template>
             </fo:block>
           </fo:table-cell>
-          <fo:table-cell text-align="right"
+          <fo:table-cell text-align="end"
                          display-align="after">
             <xsl:if test="$fop.extensions = 0">
               <xsl:attribute name="relative-align">baseline</xsl:attribute>
               <xsl:call-template name="footer.content">
                 <xsl:with-param name="pageclass" select="$pageclass"/>
                 <xsl:with-param name="sequence" select="$sequence"/>
-                <xsl:with-param name="position" select="'right'"/>
+                <xsl:with-param name="position" select="$direction.align.end"/>
                 <xsl:with-param name="gentext-key" select="$gentext-key"/>
               </xsl:call-template>
             </fo:block>
index d8613bc24ba5204a14a5804f7fa69506e8932829..82f1bdcf19e32c34e5f544e040e0f2ada1aa4314 100644 (file)
 
     <xsl:if test="$colsep &gt; 0 and number($colnum) &lt; ancestor::tgroup/@cols">
       <xsl:call-template name="border">
-        <xsl:with-param name="side" select="'right'"/>
+        <xsl:with-param name="side" select="'end'"/>
       </xsl:call-template>
     </xsl:if>
 
 
   <xsl:choose>
     <xsl:when test="$frame='all'">
-      <xsl:attribute name="border-left-style">
+      <xsl:attribute name="border-start-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
-      <xsl:attribute name="border-right-style">
+      <xsl:attribute name="border-end-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
       <xsl:attribute name="border-top-style">
       <xsl:attribute name="border-bottom-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
-      <xsl:attribute name="border-left-width">
+      <xsl:attribute name="border-start-width">
         <xsl:value-of select="$table.frame.border.thickness"/>
       </xsl:attribute>
-      <xsl:attribute name="border-right-width">
+      <xsl:attribute name="border-end-width">
         <xsl:value-of select="$table.frame.border.thickness"/>
       </xsl:attribute>
       <xsl:attribute name="border-top-width">
       <xsl:attribute name="border-bottom-width">
         <xsl:value-of select="$table.frame.border.thickness"/>
       </xsl:attribute>
-      <xsl:attribute name="border-left-color">
+      <xsl:attribute name="border-start-color">
         <xsl:value-of select="$table.frame.border.color"/>
       </xsl:attribute>
-      <xsl:attribute name="border-right-color">
+      <xsl:attribute name="border-end-color">
         <xsl:value-of select="$table.frame.border.color"/>
       </xsl:attribute>
       <xsl:attribute name="border-top-color">
       </xsl:attribute>
     </xsl:when>
     <xsl:when test="$frame='bottom'">
-      <xsl:attribute name="border-left-style">none</xsl:attribute>
-      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-start-style">none</xsl:attribute>
+      <xsl:attribute name="border-end-style">none</xsl:attribute>
       <xsl:attribute name="border-top-style">none</xsl:attribute>
       <xsl:attribute name="border-bottom-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
     </xsl:when>
     <xsl:when test="$frame='sides'">
-      <xsl:attribute name="border-left-style">
+      <xsl:attribute name="border-start-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
-      <xsl:attribute name="border-right-style">
+      <xsl:attribute name="border-end-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
       <xsl:attribute name="border-top-style">none</xsl:attribute>
       <xsl:attribute name="border-bottom-style">none</xsl:attribute>
-      <xsl:attribute name="border-left-width">
+      <xsl:attribute name="border-start-width">
         <xsl:value-of select="$table.frame.border.thickness"/>
       </xsl:attribute>
-      <xsl:attribute name="border-right-width">
+      <xsl:attribute name="border-end-width">
         <xsl:value-of select="$table.frame.border.thickness"/>
       </xsl:attribute>
-      <xsl:attribute name="border-left-color">
+      <xsl:attribute name="border-start-color">
         <xsl:value-of select="$table.frame.border.color"/>
       </xsl:attribute>
-      <xsl:attribute name="border-right-color">
+      <xsl:attribute name="border-end-color">
         <xsl:value-of select="$table.frame.border.color"/>
       </xsl:attribute>
     </xsl:when>
     <xsl:when test="$frame='top'">
-      <xsl:attribute name="border-left-style">none</xsl:attribute>
-      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-start-style">none</xsl:attribute>
+      <xsl:attribute name="border-end-style">none</xsl:attribute>
       <xsl:attribute name="border-top-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
       </xsl:attribute>
     </xsl:when>
     <xsl:when test="$frame='topbot'">
-      <xsl:attribute name="border-left-style">none</xsl:attribute>
-      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-start-style">none</xsl:attribute>
+      <xsl:attribute name="border-end-style">none</xsl:attribute>
       <xsl:attribute name="border-top-style">
         <xsl:value-of select="$table.frame.border.style"/>
       </xsl:attribute>
       </xsl:attribute>
     </xsl:when>
     <xsl:when test="$frame='none'">
-      <xsl:attribute name="border-left-style">none</xsl:attribute>
-      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-start-style">none</xsl:attribute>
+      <xsl:attribute name="border-end-style">none</xsl:attribute>
       <xsl:attribute name="border-top-style">none</xsl:attribute>
       <xsl:attribute name="border-bottom-style">none</xsl:attribute>
     </xsl:when>
         <xsl:text>Impossible frame on table: </xsl:text>
         <xsl:value-of select="$frame"/>
       </xsl:message>
-      <xsl:attribute name="border-left-style">none</xsl:attribute>
-      <xsl:attribute name="border-right-style">none</xsl:attribute>
+      <xsl:attribute name="border-start-style">none</xsl:attribute>
+      <xsl:attribute name="border-end-style">none</xsl:attribute>
       <xsl:attribute name="border-top-style">none</xsl:attribute>
       <xsl:attribute name="border-bottom-style">none</xsl:attribute>
     </xsl:otherwise>
 <!-- ==================================================================== -->
 
 <xsl:template name="border">
-  <xsl:param name="side" select="'left'"/>
+  <xsl:param name="side" select="'start'"/>
 
   <xsl:attribute name="border-{$side}-width">
     <xsl:value-of select="$table.cell.border.thickness"/>
       <xsl:if test="$colsep.inherit &gt; 0 and 
                       $col &lt; (ancestor::tgroup/@cols|ancestor::entrytbl/@cols)[last()]">
         <xsl:call-template name="border">
-          <xsl:with-param name="side" select="'right'"/>
+          <xsl:with-param name="side" select="'end'"/>
         </xsl:call-template>
       </xsl:if>