Menu

#1367 Attribution in epigraph displayed twice in HTML/XHTML

output: all formats
pending-fixed
None
5
2015-10-15
2015-09-22
No

The fo, html, xhtml, and xhtml-1_1 stylesheets all render the attribution for an epigraph twice, once before the epigraph and once after. The problem appears to be in the d:epigraph template in block.xsl. Here is that template from the xhtml-1_1 file, but the code is identical in all of the html-related templates:

<xsl:template match="d:epigraph">


<xsl:call-template name="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<xsl:apply-templates select="node()&lt;span&gt;[not(local-name(d:attribution))]&lt;/span&gt;"/>
<xsl:if test="d:attribution">

—<xsl:apply-templates select="d:attribution"/>

</xsl:if>

</xsl:template>

I think the problem is that the select statement in the fifth line doesn't properly exclude the attribution. If I replace that line with the following (copied from similar code in blockquote), the template seems to work correctly:

<xsl:apply-templates select="child::*[local-name(.)!='attribution']"/>

It looks like this was introduced in revision 9914 (2014-04-30), when the epigraph template was edited to handle all children (except attribution) instead of a select group of specific elements. I think replacing the select statement as shown above should achieve the same goal without doubling up attribution.

Discussion

  • Richard Hamilton

    I just noticed that this form mangles the xsl. Sorry about that. But I think the overall point still comes through. Also, FYI, I found this in a snapshot, 1.78.1 does not have this problem.

     
  • Robert Stayton

    Robert Stayton - 2015-10-15

    I checked in the fix for this. Thanks.

     
  • Robert Stayton

    Robert Stayton - 2015-10-15
    • status: open --> pending-fixed
    • assigned_to: Robert Stayton