On Tue, Apr 20, 2010 at 4:27 AM, Hussein Shafie <[email protected]> wrote:
> This is pretty easy to do. However, if you have problems doing that,
> we'll help you.

Thank you for the guidance and help.

Here is my custom_fo.xsl file. It is working, but I thought I would
post it for comment/improvement if anyone reading would care to
provide feedback.

          -Doug


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                xmlns:fo="http://www.w3.org/1999/XSL/Format";
                version="2.0">
    <xsl:import href="ditac-xsl:fo/fo.xsl"/>

  <!-- tabularHeader ===================================================== -->
  <xsl:param name="footer-center-color">black</xsl:param>
  <xsl:param name="header-center-color">black</xsl:param>

  <xsl:param name="footer-center-size">100%</xsl:param>
  <xsl:param name="header-center-size">100%</xsl:param>

  <xsl:template name="tabularHeader">
    <xsl:param name="left" select="()"/>
    <xsl:param name="center" select="()"/>
    <xsl:param name="right" select="()"/>
    <xsl:param name="isFooter" select="false()"/>

    <xsl:variable name="verticalAlign"
                  select="if ($isFooter) then 'before' else 'after'"/>

    <fo:block xsl:use-attribute-sets="tabular-header">
      <xsl:choose>
        <xsl:when test="$isFooter and $footer-separator = 'yes'">
          <xsl:attribute name="border-top-style">solid</xsl:attribute>
          <xsl:attribute name="padding-top">0.125em</xsl:attribute>
        </xsl:when>
        <xsl:when test="not($isFooter) and $header-separator = 'yes'">
          <xsl:attribute name="padding-bottom">0.125em</xsl:attribute>
          <xsl:attribute name="border-bottom-style">solid</xsl:attribute>
        </xsl:when>
      </xsl:choose>

      <fo:table table-layout="fixed" width="100%">
        <fo:table-column column-number="1"
                         column-width="proportional-column-width(2)"/>
        <fo:table-column column-number="2"
                         column-width="proportional-column-width(6)"/>
        <fo:table-column column-number="3"
                         column-width="proportional-column-width(2)"/>
        <fo:table-body>
          <fo:table-row>
            <fo:table-cell start-indent="0"
                           text-align="left" display-align="{$verticalAlign}">
              <fo:block>
                <xsl:choose>
                  <xsl:when test="exists($left)">
                    <xsl:copy-of select="$left"/>
                  </xsl:when>
                  <xsl:otherwise>&#xA0;</xsl:otherwise>
                </xsl:choose>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell start-indent="0"
                           text-align="center" display-align="{$verticalAlign}">
              <fo:block>
                <xsl:attribute name="color"
                    select="if ($isFooter) then $footer-center-color
else $header-center-color"/>
                <xsl:attribute name="font-size"
                    select="if ($isFooter) then $footer-center-size
else $header-center-size"/>
                <xsl:choose>
                  <xsl:when test="exists($center)">
                    <xsl:copy-of select="$center"/>
                  </xsl:when>
                  <xsl:otherwise>&#xA0;</xsl:otherwise>
                </xsl:choose>
              </fo:block>
            </fo:table-cell>
            <fo:table-cell start-indent="0"
                           text-align="right" display-align="{$verticalAlign}">
              <fo:block>
                <xsl:choose>
                  <xsl:when test="exists($right)">
                    <xsl:copy-of select="$right"/>
                  </xsl:when>
                  <xsl:otherwise>&#xA0;</xsl:otherwise>
                </xsl:choose>
              </fo:block>
            </fo:table-cell>
          </fo:table-row>
        </fo:table-body>
      </fo:table>
    </fo:block>
  </xsl:template>


</xsl:stylesheet>
 
--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support

Reply via email to