|
Subject: Re: [xsl] grouping/position problem From: Bruce D'Arcus <bdarcus@xxxxxxxxx> Date: Sun, 24 Apr 2005 10:00:16 -0400 |
In effect you need to sort by year before you group by year, and set
shorten-author to true for all but the first item in the list of items for
an author in year order.
Something like:
<list> <item author="one" year="2001"/> <item author="one" year="2001"/> <item author="one" year="2002"/> </list>
<xsl:template match="/">
<xsl:apply-templates select="$enhanced-biblist/result"/>
</xsl:template> <xsl:variable name="enhanced-biblist">
<xsl:choose>
<xsl:when test="$sort_order='citekey'">
<xsl:apply-templates select="list" mode="sort_citekey"/>
</xsl:when>
<xsl:when test="$sort_order='cited'">
<xsl:apply-templates select="list" mode="sort_cited"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="list" mode="sort_author-year"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable> <xsl:template match="item" mode="enhance">
<xsl:param name="shorten-author"/>
<xsl:param name="year"/>
<item>
<shorten-author>
<xsl:value-of select="$shorten-author"/>
</shorten-author>
<year>
<xsl:value-of select="$year"/>
</year>
<author>
<xsl:value-of select="@author"/>
</author>
</item>
</xsl:template> <xsl:template match="item">
<xsl:param name="shorten-author"/>
<xsl:param name="year"/>
<xsl:copy-of select="."/>
</xsl:template><?xml version="1.0" encoding="UTF-8"?>
<biblist>
<item>
<shorten-author>false</shorten-author>
<year>2001a</year>
<author>one</author>
</item>
<item>
<shorten-author>true</shorten-author>
<year>2001b</year>
<author>one</author>
</item>
<item>
<shorten-author>true</shorten-author>
<year>2002</year>
<author>one</author>
</item>
</biblist>| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] grouping/position problem, Michael Kay | Thread | RE: [xsl] grouping/position problem, Michael Kay |
| [xsl] Adding line breaks in Title a, Carl Jenkins | Date | RE: [xsl] Adding line breaks in Tit, Michael Kay |
| Month |