if the second table can be placed within the same page as the first table, i want to fade out the header. if the second table gets on the next page because of the "keep together", I want to show the header
There are a few options for modifying the headers of a single table that spans page breaks. See table-omit-header-at-break and rx:table-omit-initial-header (the latter is a XEP extension).
But what you are asking for is not possible. The display of a table header cannot depend on whether the table falls on the same output page as another table.
Creating AFP (or PDF) output from XSL-FO is a process with two independent stages:
- The required FO markup is generated (applying an XSLT stylesheet to an XML source document is the most common way to do this).
- The generated markup is processed by a FO engine that lays out the content on one or more output pages.
You imagine something like this:
<xsl:if test="$keep-together.within-page !=''">
...
</xsl:if>
This is impossible. It is an attempt to blur the line between the two stages. In stage 1, nothing is known about the actual pages that are produced in stage 2.
In XSL-FO, you can specify rules for various contingencies (conditions on properties such as keep-with-next
, keep-together
, orphans
, widows
, etc). But there is no way to test if table B is on the same page as table A or if a property has "taken effect". It just does not work that way.