|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: alphabetic counters - Solved
For the archives, here is the final solution:
XML: <food cite="bob1"/> <food cite="bob2"/> <food cite="jim"/> <citation id="bob1" author="Bob et al." year="2004" title="Fish & Chips" /> <citation id="bob2" author="Bob et al." year="2004" title="Bangers & Mash" /> <citation id="jim" author="Jim et al." year="2004" title="Toad in the Hole" /> XSLT: <xsl:key name="refs" match="citation" use="concat(@author,'+', @year)" /> <xsl:for-each select="food"> <xsl:value-of select="id(@cite)/@author" /> <xsl:text> </xsl:text> <xsl:value-of select="id(@cite)/@year" /> <xsl:variable name="cite" select="@cite" /> <xsl:if test="count(key('refs', concat(id(@cite)/@author,'+',id(@cite)/@year))) > 1"> <xsl:for-each select="key('refs', concat(id(@cite)/@author,'+',id(@cite)/@year))"> <xsl:if test="@id = $cite"><xsl:number value="position()" format="a" /></xsl:if> </xsl:for-each> </xsl:if> </xsl:for-each> Output: Bob et al. 2004a Bob et al. 2004b Jim et al. 2003
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








