Dates showing as n.d. when Year comes after YearAccessed

Oct 30, 2010 at 4:51 AM
Edited Oct 30, 2010 at 4:52 AM

I'm using the following format string for an Internet Site source type:

<format>{%Author:2|"Anon."%}{ "%Title%,"}{ in:%InternetSiteTitle%,}{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{ %MonthAccessed:s%}{ %DayAccessed%,} %YearAccessed%]}{ %Year|"n.d."%}.</format>

Whenever the citation appears in the Bibliography, the Year always shows up as "n.d.". However, if I move the { %Year|"n.d."%} tag so that it is placed before the "Accessed" tag, then the date shows up fine. Oddly enough, if I simply remove the %YearAccessed% tag, then the %Year% tag displays correctly. It's as if the use of the %YearAccessed% tag is erasing the contents of the %Year% tag, but not the other way around.

Any ideas on what might cause this?

P.s. I should mention that this problem seems to occur in both Word 2010 and Word for Mac 2011. I haven't tried this with Word 2007, though.

Coordinator
Oct 30, 2010 at 2:41 PM

Quick and easy workaround in your case: add an 'r' option after YearAccessed. So your line would become

<format>{%Author:2|"Anon."%}{ "%Title%,"}{ in:%InternetSiteTitle%,}{ Available at: &lt;u&gt;%URL:l%&lt;/u&gt;}{ [Accessed{ %MonthAccessed:s%}{ %DayAccessed%,} %YearAccessed:r%]}{ %Year|"n.d."%}.</format>

But this is really a bug in BibWord which affects all parameters which have a name which is the start of the name of another parameter (Day, Month, Year). A full fix would be to change the following three lines in the code (I will incorporate them in the next release but you can already do it yourself if you want).

Change (1)

<xsl:with-param name="used" select="concat($used, $usedAtCurrentLevel)"/>

into

<xsl:with-param name="used" select="concat(concat($used, $usedAtCurrentLevel), '-')"/>

and change (2)

<xsl:when test="(($name != 'Author' and string($source/*[local-name() = $name])) or string($source/b:Author/*[local-name() = $name])) and not(contains($used, concat('-', $name)))">

into

<xsl:when test="(($name != 'Author' and string($source/*[local-name() = $name])) or string($source/b:Author/*[local-name() = $name])) and not(contains($used, concat(concat('-', $name), '-')))">

and change (3)

<xsl:when test="starts-with($name, '&#x22;') and substring($name, string-length($name), 1) = '&#x22;' and not(contains($used, concat('-', $name)))">

into

<xsl:when test="starts-with($name, '&#x22;') and substring($name, string-length($name), 1) = '&#x22;' and not(contains($used, concat(concat('-', $name), '-')))">

Thanks for reporting this.

Oct 30, 2010 at 2:51 PM

yves,

Thank you! The fix worked perfectly!