I wanted to try a two column layout for a small table. I copied the existing simple-page-master and added column-count="2"
. (I'm not including headers or footers for brevity.) The template works as expected if I delete the fo:page-sequence
and fo:flow
but otherwise I'm getting nothing in my output. I tried substituting another template for numIndex and that also fails.
I'm using Antenna House. As always, I appreciate any suggestions.
<fo:simple-page-master master-name="body-page-two-col" xsl:use-attribute-sets="odd-page-atts">
<fo:region-body region-name="region-body" xsl:use-attribute-sets="body-atts" column-count="2"/>
</fo:simple-page-master>
<xsl:attribute-set name="odd-page-atts">
<xsl:attribute name="page-height">11in</xsl:attribute>
<xsl:attribute name="page-width">8.5in</xsl:attribute>
<xsl:attribute name="margin-top">1.5pc</xsl:attribute>
<xsl:attribute name="margin-bottom">1.5pc</xsl:attribute>
<xsl:attribute name="margin-left">1in</xsl:attribute>
<xsl:attribute name="margin-right">.5in</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="body-atts">
<xsl:attribute name="margin-top">4.5pc</xsl:attribute>
<xsl:attribute name="margin-bottom">4.5pc</xsl:attribute>
</xsl:attribute-set>
<xsl:template name="numIndex">
<fo:page-sequence master-reference="body-page-two-col" initial-page-number="auto" format="1">
<fo:flow flow-name="region-body">
<fo:block>
<fo:table-and-caption>
<fo:table-caption>
<fo:block>
<xsl:text>Numerical Index</xsl:text>
</fo:block>
</fo:table-caption>
<fo:table>
<xsl:attribute name="id"><xsl:apply-templates select="ancestor::dmodule/identAndStatusSection/dmAddress/dmIdent/dmCode"/><xsl:text>tbl-numidx001</xsl:text></xsl:attribute>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block font-size="11pt" font-style="italic" >
<fo:retrieve-table-marker retrieve-class-name="continued-ni" retrieve-boundary-within-table="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:marker marker-class-name="continued-ni"/>
<fo:marker marker-class-name="continued-ni">
<fo:block text-align="center">Numerical Index  (Continued)
</fo:block>
</fo:marker>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:table border-bottom="solid" border-bottom-width=".5pt"
border-top="solid" border-top-width=".5pt" font-size="8pt"
margin-bottom="8pt" margin-left="3pt" margin-right="3pt" margin-top="8pt"
relative-position="static" space-after.maximum="12pt" space-after.minimum="12pt"
space-after.optimum="12pt" space-before.maximum="14pt" space-before.minimum="12pt"
space-before.optimum="12pt" span="all" table-layout="fixed" table-omit-header-at-break="false"
table-omit-footer-at-break="true" text-align="start" white-space-treatment="preserve"
width="3.0in" hyphenate="true" cols="4">
<fo:table-column column-number="1" column-width="30%"/>
<fo:table-column column-number="2" column-width="20%"/>
<fo:table-column column-number="3" column-width="20%"/>
<fo:table-column column-number="4" column-width="20%"/>
<fo:table-header>
<xsl:call-template name="NI-HEADER"/>
</fo:table-header>
<fo:table-body>
<xsl:call-template name="SortParts"/>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-and-caption>
</fo:flow>
</fo:block>
</fo:page-sequence>
</xsl:template>
This is what calls numIndex:
<xsl:template match="illustratedPartsCatalog">
<xsl:apply-templates />
<xsl:call-template name="numIndex"/>
</xsl:template>
If I understand you correctly, you want a table that flows into two columns within your regular one-column flow. Since you're using AH Formatter, you can use a two-column fo:block-container
to contain just the table. See https://www.antennahouse.com/product/ahf64/ahf-ext.html#axf.column-count. However that's not going to get you your '(continued)' marker. To do that, you could put the fo:block-container
as the child of the fo:table-cell
from the outer fo:table
.
However, since I'm not at all sure that I do understand your requirement, could you do a simple graphic illustration of what you are looking for?
Also, if, as you show in your code sample, the fo:simple-page-master
is outside any xsl:template
, it will be ignored by the XSLT processor and will not appear in your FO file.
According to https://www.w3.org/TR/xslt#stylesheet-element:
an XSLT processor is always free to ignore such top-level elements, and must ignore a top-level element without giving an error if it does not recognize the namespace URI.