Hello,
I am having a problem with fo:marker giving an undesired result in a certain instance, and I was hoping someone might be able to suggest a solution.
In creating a pdf, several XML files (data modules from S1000D) are called together to make one chapter. These files have different titles (stored in either infoname or techname). They can also be a few sentences or several pages long with the start of every new file being preceded by its title. Should an XML file take more than one page, then the start of every page following the first one where it appears is “[Title Value] -Cont” until a new XML file is referenced or the chapter ends. This is done using fo:markers.
The relevant code is shown below.
Code:
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="text-10" keep-with-next="100" space-before="6pt">
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row height=".25in">
<fo:table-cell>
<fo:block xsl:use-attribute-sets="text-10" keep-with-next="100">
<fo:marker marker-class-name="primary-para-continuation">
<xsl:choose>
<xsl:when test="string-length(normalize-space(ancestor::dmodule/idstatus/dmaddres/dmtitle/infoname)) > 0">
<fo:inline word-spacing="-1px">
<xsl:value-of select="upper-case(ancestor::dmodule/idstatus/dmaddres/dmtitle/infoname)"/> - Cont
</fo:inline>
</xsl:when>
<xsl:when test="string-length(normalize-space(ancestor::dmodule/idstatus/dmaddres/dmtitle/techname)) > 0">
<fo:inline word-spacing="-1px">
<xsl:value-of select="upper-case(ancestor::dmodule/idstatus/dmaddres/dmtitle/techname)"/> - Cont
</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline word-spacing="-1px">
<xsl:text>No value found in infoname or techname of Data Module</xsl:text>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</fo:marker>
<fo:block xsl:use-attribute-sets="text-10-bold">
<xsl:if test="ancestor::dmodule/idstatus/dmaddres/dmtitle/infoname/@proportions = 'modify' or ancestor::dmodule/idstatus/dmaddres/dmtitle/infoname/@proportions = 'add' or ancestor::dmodule/idstatus/dmaddres/dmtitle/techname/@proportions = 'modify' or ancestor::dmodule/idstatus/dmaddres/dmtitle/techname/@proportions = 'add'">
<xsl:call-template name="rev.bar"/>
</xsl:if>
<xsl:choose>
<xsl:when test="string-length(normalize-space(ancestor::dmodule/idstatus/dmaddres/dmtitle/infoname)) > 0">
<xsl:value-of select="upper-case(ancestor::dmodule/idstatus/dmaddres/dmtitle/infoname)"/>
</xsl:when>
<xsl:when test="string-length(normalize-space(ancestor::dmodule/idstatus/dmaddres/dmtitle/techname)) > 0">
<xsl:value-of select="upper-case(ancestor::dmodule/idstatus/dmaddres/dmtitle/techname)"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>No value found in infoname or techname of Data Module</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<xsl:apply-templates select="mainfunc | prelreqs/safety/safecond | processing-instruction()"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
Code:
<fo:retrieve-marker retrieve-class-name="primary-para-continuation" retrieve-position="first-including-carryover" retrieve-boundary="page-sequence"/>
At one point, a writer put a processing instruction causing a page break at the beginning of one of the xml files. This forced that XML file to begin on a new page. There was also an instance of where the xml file began on a new page within the 'natural' flow of the document.
The resulting output for the title on the first page was:
“[Title Value] -Cont ”
[Title Value]”
(Note: only “[Title Value] -Cont" is generated by fo:retrieve-marker where the “[Title Value]” is correctly called elsewhere.)
and
“[Title Value] -Cont”
for all the pages following it until the xml file ended.
The desired output for the first page, however, is
“[Title Value]”
while the following pages should have
"[Title Value] -Cont ”
I attempted to use some logic triggered by the processing instruction, but only succeeded in removing “[Title Value] -Cont ” from all pages instead of just the first. Nor would this have helped for those instances where the processing instruction was not used.
Could someone please suggest a way to remove “[Title Value] -Cont” (the text generated by fo:retrieve-marker) only on the relevant ‘first’ page and not on the following pages?
Thanks for taking the time to consider this problem and for any suggestions that may be offered.