docbook-apps

Footnote mark not generated in informal tables

  • 1.  Footnote mark not generated in informal tables

    Posted 06-07-2012 09:55
    I have a customisation to format the footnotes (both the footnote mark
    and the text) in formal tables and informal tables. For an informal
    table, the footnote mark is only generated within a table cell -- the
    mark is not being generated below the table, but the footnote text
    appears there. In formal tables, the footnotes are correctly generated
    with a footnote mark. Here is the fo output from each table to compare
    -- the fo:inline coding is missing from the informaltable:

    *Example from a formal table:*

    <fo:blockxmlns:xi="http://www.w3.org/2001/XInclude"
    keep-with-previous.within-column="always"><fo:blockfont-family="sans-serif"
    font-size="8pt"font-weight="normal"font-style="normal"
    space-before="0mm"text-align="left"color="#000000"start-indent="0mm"
    ><fo:blockxmlns:xlink="http://www.w3.org/1999/xlink"><fo:inline
    font-family="sans-serif"font-size="75%"font-weight="normal"
    font-style="normal"baseline-shift="super">a </fo:inline>Water
    is sourced from groundwater aquifers within the Port Hedland
    SWMA</fo:block></fo:block></fo:block>

    *Example from an informaltable:*

    <fo:blockxmlns:xi="http://www.w3.org/2001/XInclude"
    keep-with-previous.within-column="always"><fo:block
    font-family="sans-serif"font-size="8pt"font-weight="normal"
    font-style="normal"space-before="0mm"text-align="left"
    color="#000000"start-indent="0mm"><fo:block
    xmlns:xlink="http://www.w3.org/1999/xlink">see examples in
    <fo:inlinefont-style="italic">Water Act 1989 Permissible
    Consumptive Volume Groundwater Order July 2008</fo:inline>,
    Victoria Government Gazette, 3 July 2008, p
    1591</fo:block></fo:block></fo:block>

    I've rechecked all possible coding -- here are my customisations (Maybe
    the problem is in template format.footnote.mark because that is the only
    relevant template I can see generating fo:inline, but I don't see how
    because formal table footnotes generate OK):

    <xsl:templatematch="d:footnote">
    <xsl:choose>
    <xsl:whentest="ancestor::d:table or ancestor::d:informaltable">
    <xsl:call-templatename="format.footnote.mark">
    <xsl:with-paramname="mark">
    <xsl:apply-templatesselect="."mode="footnote.number"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:when>

    <xsl:otherwise>
    <xsl:choose>
    <xsl:whentest="$footnotealign != '0'">
    <fo:footnote>
    <fo:inline>
    <xsl:call-templatename="format.footnote.mark">
    <xsl:with-paramname="mark">
    <xsl:apply-templatesselect="."mode="footnote.number"/>
    </xsl:with-param>
    </xsl:call-template>
    </fo:inline>
    <fo:footnote-bodyxsl:use-attribute-sets="footnote.properties">
    <fo:list-blockspace-after="{$leadingafterpagefootnote}">
    <fo:list-item>
    <fo:list-item-labelend-indent="label-end()">
    <fo:block>
    <xsl:choose>
    <xsl:whentest="$footnotemarkbig != '0'">
    <xsl:apply-templatesselect="."mode="footnote.number"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:call-templatename="format.footnote.mark">
    <xsl:with-paramname="mark">
    <xsl:apply-templatesselect="."mode="footnote.number"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:otherwise>
    </xsl:choose>
    </fo:block>
    </fo:list-item-label>

    <fo:list-item-bodystart-indent="{$pagefootnotetextleftmargin}">
    <xsl:apply-templates/>
    </fo:list-item-body>
    </fo:list-item>
    </fo:list-block>
    </fo:footnote-body>
    </fo:footnote>
    </xsl:when>

    <xsl:otherwise>
    <fo:footnote>
    <fo:inline>
    <xsl:call-templatename="format.footnote.mark">
    <xsl:with-paramname="mark">
    <xsl:apply-templatesselect="."mode="footnote.number"/>
    </xsl:with-param>
    </xsl:call-template>
    </fo:inline>

    <fo:footnote-bodyxsl:use-attribute-sets="footnote.properties">
    <xsl:apply-templates/>
    </fo:footnote-body>
    </fo:footnote>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    <xsl:templatename="format.footnote.mark">
    <xsl:paramname="mark"select="'?'"/>
    <xsl:choose>
    <xsl:whentest="ancestor::d:table or ancestor::d:informaltable">
    <fo:inlinexsl:use-attribute-sets="table.footnote.mark.properties">
    <xsl:choose>
    <xsl:whentest="$fop.extensions != 0">
    <xsl:attributename="vertical-align">super</xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attributename="baseline-shift">super</xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:copy-ofselect="$mark"/>
    <xsl:text></xsl:text>
    </fo:inline>
    </xsl:when>
    <xsl:otherwise>
    <fo:inlinexsl:use-attribute-sets="footnote.mark.properties">
    <xsl:choose>
    <xsl:whentest="$fop.extensions != 0">
    <xsl:attributename="vertical-align">super</xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
    <xsl:attributename="baseline-shift">super</xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:copy-ofselect="$mark"/>
    </fo:inline>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    <xsl:templatematch="d:footnote"mode="footnote.number">
    <xsl:choose>
    <xsl:whentest="string-length(@label) != 0">
    <xsl:value-ofselect="@label"/>
    </xsl:when>
    <xsl:whentest="ancestor::d:table or ancestor::d:informaltable">
    <xsl:variablename="tfnum">
    <xsl:numberlevel="any"from="d:table|d:informaltable"format="1"/>
    </xsl:variable>

    <xsl:choose>
    <xsl:whentest="string-length($tables.footnote.number.symbols) >=
    $tfnum">
    <xsl:value-ofselect="substring($tables.footnote.number.symbols, $tfnum,
    1)"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:numberlevel="any"from="d:table|d:informaltable"
    format="{$tables.footnote.number.format}"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
    <xsl:variablename="fnum">


















    <xsl:numberlevel="any"
    from="d:chapter|d:appendix|d:preface|d:article|d:refentry|d:bibliography"
    count="d:footnote[not(@label)][not(ancestor::d:table) and
    not(ancestor::d:informaltable)]
    |d:ulink[$ulink.footnotes != 0][node()][@url !=
    .][not(ancestor::d:footnote)][$ulink.show != 0]
    |*[node()][@xlink:href][not(@xlink:href =
    .)][not(starts-with(@xlink:href,'#'))]
    [not(contains(@xlink:href,'#') and @xlink:role = $xolink.role)]
    [not(@xlink:type) or @xlink:type='simple']
    [not(ancestor::d:footnote)][$ulink.footnotes != 0][$ulink.show != 0]
    "
    format="1"/>
    </xsl:variable>
    <xsl:choose>
    <xsl:whentest="string-length($footnote.number.symbols) >= $fnum">
    <xsl:value-ofselect="substring($footnote.number.symbols, $fnum, 1)"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:numbervalue="$fnum"format="{$footnote.number.format}"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    <xsl:attribute-setname="table.footnote.mark.properties">
    <xsl:attributename="font-family">
    <xsl:value-ofselect="$graphictypeface"/>
    </xsl:attribute>
    <xsl:attributename="font-size">
    <xsl:value-ofselect="$cellfootnotefontsize"/>
    </xsl:attribute>
    <xsl:attributename="font-weight">
    <xsl:value-ofselect="$cellfootnotefontweight"/>
    </xsl:attribute>
    <xsl:attributename="font-style">
    <xsl:value-ofselect="$cellfootnotefontstyle"/>
    </xsl:attribute>
    </xsl:attribute-set>

    --
    *Dave Gardiner*