Skip to content

XSLT adds empty brackets around reference year even when year is not present. #4373

Description

@ajrbyers

Describe the bug
When transforming an element-citation our XSL will attempt to add the year of the reference after person-group. It will do so even if there is no year present in the citation. Although JATS recommends adding year as best practice it is not enforced. See: https://jats.nlm.nih.gov/archiving/tag-library/1.2/element/element-citation.html

Janeway version
The version of Janeway under which the bug has been reproduced.
If running off of master, please, indicate the current HEAD of the Janeway installation

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
If year is not present, no brackets should be displayed.

<xsl:when test="self::person-group/@person-group-type='author'">
<xsl:apply-templates select="node()" mode="none"/>
<xsl:if test="not(preceding-sibling::person-group)">
<xsl:text> (</xsl:text>
<xsl:value-of select="..//year"/>
<xsl:text>).</xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test="self::person-group/@person-group-type='editor'">
<xsl:apply-templates select="node()" mode="none"/>
<xsl:if test="not(preceding-sibling::person-group)">
<xsl:text>. (</xsl:text>
<xsl:value-of select="..//year"/>
<xsl:text>).</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="node()" mode="none"/>
</xsl:otherwise>
</xsl:choose>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething's not working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions