Douglas W Philips wrote: > > 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. > > <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> </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> </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> </xsl:otherwise> > </xsl:choose> > </fo:block> > </fo:table-cell> > </fo:table-row> > </fo:table-body> > </fo:table> > </fo:block> > </xsl:template> > > > </xsl:stylesheet> >
Your customization looks fine. In our opinion, the flexibility you have added is not generic enough to be integrated to our stock XSL stylesheets. I mean, any other user having specific needs is really expected to redefine attribute-set "tabular-header" and/or named template "tabularHeader" in her/his own "custom_fo.xsl". Thank you posting this because it gives other users a good example of what to do. Douglas W Philips wrote: > at the very bottom of the page, it says: > Alternatively add the following -xslt2 options to your ditac.options > file. > ... > -xslt2 docx absolute_filename_of_custom_fo.xsl > ... > > but the switch -xslt2 does not work. I think it should be -xslt instead. > Also, on that page, there is a link: > http://www.xmlmind.com/ditac/_distrib/doc/manual/customize/custom_fo.xsl > however if you just blindly download that file assuming that the > contents match the text on the web page, you'll find it doesn't work. > http://www.xmlmind.com/ditac/_distrib/doc/manual/customize/custom_fo.xsl > is missing the name space declarations (which are present on the main > page). We'll check these two points and fix all found bugs. -- XMLmind DITA Converter Support List [email protected] http://www.xmlmind.com/mailman/listinfo/ditac-support

