Hello,
I was hoping someone might be able to provide some advice for the following problem.
Xsl:for-each-group is being used to create a list of items with unique values. The difficulty is the attributes of any element will not be processed unless it belongs to the first instance.
For example
The XML
Code:
<group>
<supplyli>
<supply change=âaddâ>item x </supply>
<supply>item y </supply>
<supply>item z </supply>
<supply>item x </supply>
<supply change=âaddâ>item y </supply>
<supply>item z </supply>
</supplyli>
</group>
is being processed by the xslt
Code:
<xsl:for-each-group select="descendant::supplyli/supply" group-by=".">
<fo:block>
<xsl:if test="@change='modify' or @change='add'">
<xsl:call-template name="rev.bar"/>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:for-each-group>
The result is that item x, item y, and item z are each processed, and appear only once. In addition, rev.bar gets called for item x as the first instance contains the change attribute, but rev.bar does not get called for item y as its first instance does not.
The appearance in the output pdf would be
item x |
item y
item z
[ | being the output from rev.bar]
The desired outcome would be to process the two xâs and yâs differently because of their differing attributes, leading to the following output
item x |
item y
item x
item y |
item z
Thank you for reviewing the issue. Any suggestions would be appreciated.