[xsl] groupi-by statements?

Subject: [xsl] groupi-by statements?
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Wed, 18 Aug 2004 11:39:02 -0400
Here's another problem:

      <xsl:for-each-group select="current-group()"
	        group-by="substring(mods:originInfo/mods:dateIssued,1,4)">

One of the good things about the data in question is it's recursive. It's also a problem in this context. The year that is critical to this processing can be represented like:

mods:originInfo/mods:dateIssued (as above)
mods:relatedItem/mods:originInfo/mods:dateIssued (the date issued for a book, where the main record is a chapter)
mods:relatedItem/mods:part/mods:date (the sort of date you may have with a journal article; associated with the issue)


If I have more than one of these expressions in my group-by statement, I get a "A sequence of more than one item is not allowed as the first argument of substring()" error.

So how should I handle this? Should I define a function -- called, say, bib:year -- that I can call like so?

      <xsl:for-each-group select="current-group()"
	        group-by="bib:year()">

Bruce

Current Thread