[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: grouping/position problem

Subject: Re: grouping/position problem
From: Bruce D'Arcus <bdarcus@xxxxxxxxx>
Date: Fri, 22 Apr 2005 21:05:28 -0400
Re:  grouping/position problem
OK, I'm making some progress. I now correctly handle the position() values for the inner (author-year) group.

However, I still can't figure out how to get the author-shorten variable to yield true if there is more than one node in the bib:grouping-key(.) group AND the node in question is not the first in the group. So, it'd yield false if there is only one node in an author group, or if it's the first in a multiple node group. Help?

<xsl:template match="mods:modsCollection" mode="sort_author-year">
<xsl:variable name="bibrefs" select="mods:mods"/>
<xsl:for-each-group select="$bibrefs" group-by="bib:grouping-key(.)">
<xsl:sort select="current-grouping-key()"/>
<!-- my problem is the below variable; I was trying to figure out how to couple the count of the group with a count of the preceding nodes within the group, but I couldn't figure this out. Not sure it's even possible. -->
<xsl:variable name="author-shorten" as="xs:boolean"
select="count(current-group()) > 1"/>
<xsl:for-each-group select="current-group()" group-by="bib:year(.)">
<xsl:sort select="current-grouping-key()" />
<xsl:for-each select="current-group()">
<xsl:variable name="year">
<xsl:value-of select="current-grouping-key()"/>
<xsl:if test="last() > 1">
<xsl:number value="position()" format="a"/>
</xsl:if>
</xsl:variable>
<xsl:apply-templates select="mods:titleInfo">
<xsl:with-param name="year" select="$year"/>
<xsl:with-param name="author-shorten" select="$author-shorten"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:template>


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.