#1330 Easier Customization for fo:declarationss

fo (2)
Thomas Schraitle

Some formatters use fo:declarations to "group global declarations for a stylesheet" (according to http://www.w3.org/TR/xsl/#fo_declarations). For example, Antenna House use this to introduce global configuration options.

However, the current DocBook XSL stylesheet doesn't support this well. There is currently no hook which can be used. The fo:declarations element has to be added after a </fo:layout-master-set> end tag (see http://www.w3.org/TR/xsl/#fo_root). The fo:layout-master-set' is created info/pagesetup.xsl, templatesetup.pagemasters`.

The result is, a developer has to customize either (1) the whole setup.pagemasters template or (2) use the * template in mode process.root in order to introduce the fo:declarations element. Neither way is very nice as the developer has to do a lot useless of copy-and-paste.

For that reason, I would propose to add the following change in fo/pagesetup.xsl:

  • Add <xsl:call-template name="user.declarations"/> at the end of setup.pagemasters (before </xsl:template>).

  • Add an empty <xsl:template name="user.declarations"/>.

That way it is very easy to customize user.declarations without the hassle of copying the content of other templates.

This modification doesn't change the current behaviour.


  • Implemented in [r9913].



    Commit: [r9913]

  • Robert Stayton
    Robert Stayton

    • status: open --> closed-fixed