#456 refactor content param in inline.* stylesheets

output: all formats
XSL (399)

I have implemented a mechanism, whereby the content of technical inline elements are drawn in from an external source based on the attribute "role" (the source code of the project I am documenting) instead of being explicitly repeated in the docbook document. This makes sure the documentation uses the same terminologie used in the application.
This mechanism overwrites the part of the inline.* templates that calculate the content:

<xsl:param name="content">
<xsl:variable name="id" select="@role"/>
<xsl:when test="normalize-space(.)">
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">
<xsl:call-template name="getString">
<xsl:with-param name="id" select="$id"/>

This has to be repeated for all the templates (charseq, monoseq, boldseq, etc), and creates a lot of redundant code to maintain.
If the docbook stylesheet would factor out this part into its own template, which would in itself be an improvement, according to the DRY principle, this customization would be much easier:

<xsl:template name="inline.content">
<xsl:call-template name="anchor"/>
<xsl:call-template name="simple.xlink">
<xsl:with-param name="content">

I can provide a patch, if you consider the idea acceptable for inclusion into the docbook xsl distribution.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks