Customizing Headers and Footers
Posted: Wed Sep 19, 2012 7:09 pm
I've combed through this forum for details on how to modify the footer or header of a PDF and seen the suggestion repeated that one go to one of the other DITA or XML forums for specifics. I've been to the main site recommended, but the information there is usually about the DITA-OT and not oXygen. And often they end by referring you to the DITA-OT documentation! Could you help me please with an oXygen implementation of this solution?
Here is what I have done: 1) I've found the static-content.xsl file in ../DITA-OT/demo/fo/xsl/fo and seen the header and footer insert templates in that xsl. 2) I've found the static-content-attr.xsl file where the attributes of template parameters are kept. But I do not see where variables like those in the following two code examples are set.
My first question is: where are these variables in the xsl files set? At what point can I ask the xsl to pick up, say, my company name and insert it into the appropriate variable? Second, is it not possible to use Configure Transformation Scenarios in oXygen to set parameters to accomplish this? If so, how?
The DITA-OT Reference lists args.ftr and args.hdr as parameters that can be set for a footer/header. The definition says, "Specifies the location of a well-formed XML file containing your custom running footer [header] for the document body. Corresponds to xslt parameter FTR [HDR]. Note: The fragment must be valid XML with a single root element. Common practice is to place all content into <div>.
Can you give me an example of what xml would implement this? And again, how are those variables in the xsl and attributes files set?
If the solution is not fairly straightforward, this seems to be a big opportunity for a feature that would greatly simplify use of the product. I can't imagine I'm the only person with this need.
Thanks!
Gary
Here is what I have done: 1) I've found the static-content.xsl file in ../DITA-OT/demo/fo/xsl/fo and seen the header and footer insert templates in that xsl. 2) I've found the static-content-attr.xsl file where the attributes of template parameters are kept. But I do not see where variables like those in the following two code examples are set.
Code: Select all
<xsl:template name="insertBodyStaticContents">
<xsl:call-template name="insertBodyFootnoteSeparator"/>
<xsl:call-template name="insertBodyOddFooter"/>
<xsl:call-template name="insertBodyEvenFooter"/>
<xsl:call-template name="insertBodyOddHeader"/>
<xsl:call-template name="insertBodyEvenHeader"/>
<xsl:call-template name="insertBodyFirstHeader"/>
<xsl:call-template name="insertBodyFirstFooter"/>
<xsl:call-template name="insertBodyLastHeader"/>
<xsl:call-template name="insertBodyLastFooter"/>
</xsl:template>
...
<xsl:template name="insertBodyOddFooter">
<fo:static-content flow-name="odd-body-footer">
<fo:block xsl:use-attribute-sets="__body__odd__footer">
<xsl:call-template name="insertVariable">
<xsl:with-param name="theVariableID" select="'Body odd footer'"/>
<xsl:with-param name="theParameters">
<heading>
<fo:inline xsl:use-attribute-sets="__body__odd__footer__heading">
<fo:retrieve-marker retrieve-class-name="current-header"/>
</fo:inline>
</heading>
<pagenum>
<fo:inline xsl:use-attribute-sets="__body__odd__footer__pagenum">
<fo:page-number/>
</fo:inline>
</pagenum>
</xsl:with-param>
</xsl:call-template>
</fo:block>
</fo:static-content>
</xsl:template>
My first question is: where are these variables in the xsl files set? At what point can I ask the xsl to pick up, say, my company name and insert it into the appropriate variable? Second, is it not possible to use Configure Transformation Scenarios in oXygen to set parameters to accomplish this? If so, how?
The DITA-OT Reference lists args.ftr and args.hdr as parameters that can be set for a footer/header. The definition says, "Specifies the location of a well-formed XML file containing your custom running footer [header] for the document body. Corresponds to xslt parameter FTR [HDR]. Note: The fragment must be valid XML with a single root element. Common practice is to place all content into <div>.
Can you give me an example of what xml would implement this? And again, how are those variables in the xsl and attributes files set?
If the solution is not fairly straightforward, this seems to be a big opportunity for a feature that would greatly simplify use of the product. I can't imagine I'm the only person with this need.
Thanks!
Gary