Hi all,
From looking through the linked XTF instances, I don't think most of you are using Date facets. We've been using them here and have either overlooked or forgotten [1] about a small bug w/regards to that particular facet.
Basically, when we had a date range (e.g., in an EAD, <unitdate>1970-1975</unitdate>), I would see things like the following in <xtf:meta>:
<sort-year xtf:meta="true" xtf:tokenize="no">1970</sort-year>
<facet-date xtf:meta="true" xtf:facet="yes">1970::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">1971::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">1972::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">1973::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">1974::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">1975::01::01</facet-date>
<facet-date xtf:meta="true" xtf:facet="yes">::01::01</facet-date>
The above <xtf:meta> error was, I think, the cause of the attached UI error [2]. Clicking on the "01" link would result in an error page.
I think I've nailed down the problem and pulled together a working fix. In the preFilterCommon's parse:output-range() function, I've modified the first <choose><when> to:
<xsl:when test="$year2 > $year1 and ($year2 - $year1) < 500">
<xsl:for-each select="(1 to 500)">
<xsl:if test="$year1 + position() - 1 <= $year2">
<xsl:value-of select="concat($year1 + position() - 1, ' ')"/>
I haven't found a spot where the change causes problems, but I wanted to ask here if there seemed to be any glaring problems with the above. I made one other minor tweak to the stylesheet, applying a normalize-space() function on the <sort-year> result.
If there's interest, I'm happy to share a diff or the stylesheet.
Thanks for your time.
Cheers,
Bridger
--
Digital Initiatives
University of Tennessee Libraries
[1] Maybe BOTH!! :)
[2] date-indexing-correction.png