Sometimes it is necessary to display only certain table rows that meet a condition. In order to achieve this, the fo:id element is used as hint.
XF Rendering Server supports rendering documents that use the xf:display-condition extension.
This extension must be applied to fo:table-row.
Supported attributes:
• | after - the row will appear on every page where a table has areas, beginning with the page that contains the element with the specified id. |
• | before - the row will be displayed on every page before the element with the specified id. |
• | match - the row will only be displayed on the page with the specified id. |
Example of usage for xf:display-condition="is-after(id)" :
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg" font-family="Times" font-size="12pt">
<fo:layout-master-set>
<fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="3.000in">
<fo:region-body region-name="xsl-region-body" margin="0.700in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="Letter Page">
<fo:flow flow-name="xsl-region-body">
<fo:block><fo:table border-collapse="collapse" width="100%" table-layout="fixed">
<fo:table-column column-width="proportional-column-width(33.333)" column-number="1"/>
<fo:table-column column-width="proportional-column-width(33.333)" column-number="2"/>
<fo:table-column column-width="proportional-column-width(33.333)" column-number="3"/>
<fo:table-header>
<fo:table-row background="red" xf:display-condition="is-after(yellow)">
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block>The header will be displayed only after the yellow row appears.</fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<fo:table-row>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row background="yellow" id="yellow">
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell border="1pt solid black" padding="2pt">
<fo:block> </fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table> </fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Output: