Subject: Re: [xsl] Different behaviour for the first item in a for-each-group From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 31 Oct 2009 21:56:11 -0400 |
I was not careful in the way I described this problem. Each group consists of a single title with one or more citations. What I must have said is that I wanted to set the Title in each group to "keep". What I *should* have said was, I want to set the only the first group to "keep". For the input data at the end of this email, that would be the title "Further observations".
All the rest would not be marked "keep".
Clearly, I do not want (from listing 1):
<xsl:if test="position()=1">
<xsl:attribute name="keep-with-previous">always</xsl:attribute>
</xsl:if>
However, I do not know XPath well. How do I select only the first group for marking and let the other groups pass without marking them?
<xsl:for-each-group select="...population..."> <xsl:sort .../> <xsl:sort .../> <xsl:sort .../> <xsl:variable name="group-position" select="position()"/> <xsl:for-each select="current-group()"> <fo:table-row> <xsl:if test="position()=1 and $group-position=1"> <!--then at the very first of the sorted population--> <xsl:attribute name="keep-with-previous">.....
-- Upcoming: hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009 Interested in other classes? http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Different behaviour for t, Mark Wilson | Thread | Re: [xsl] Different behaviour for t, Mark Wilson |
Re: [xsl] Different behaviour for t, Mark Wilson | Date | Re: [xsl] Different behaviour for t, Mark Wilson |
Month |