Re: [xsl] group-by an optional attribute

Subject: Re: [xsl] group-by an optional attribute
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 22 Nov 2011 21:56:32 +0000
On 22/11/2011 18:33, Mark wrote:
Hi Ken,
I am finding that perhaps a pre-processing solution might be simpler
code for me to maintain as I need to sort by the @line attribute (if it
exists) and have not been able to do that after using the suggestion
you, David, and Martin provided.

Thanks everyone,

something else must be wrong, perhaps the group-by expression isn't selecting what you expect? as you could use xsl:sort select="Stamp/@line" or perhaps better, select="current-grouping-key()" with any of the solutions proposed, or in fact with your original formulation. Adding an explicit default wouldn't change the sorting much at all (except of course in most sort orders the empty case sorts first or last but if you add an explicit default you can make it any value and so anywhere in the sort order).


Current Thread