[xsl] how to make a group-by multiple attributes motionless

Subject: [xsl] how to make a group-by multiple attributes motionless
From: "Geert Bormans geert@xxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Sep 2019 21:43:54 -0000

I a streaming XSLT 3.0, I have to group a series of elements by their attribute names and values 
I have issues making the group-by motionless 

In a simplified example 

<row a="val-a-1" b="b-val"/> 
<row a="val-a-2" b="b-val"/> 
<row a="val-a-1" b="b-val"/> 
<row a="val-a-2"/> 

I need grouping this way 

<rowgroup hash="|a=val-a-1|b=b-val"/> 
<rowgroup hash="|a=val-a-2|b=b-val"/> 
<rowgroup hash="|a=val-a-2"/> 

easily achieved this way 

<xsl:for-each-group select="*" group-by="string-join(@*/concat('|', name(), '=', .), '')"> 
<rowgroup hash="{current-grouping-key()}"/> 

but, I could have data like this (third line attribute order swapped) 

<row a="val-a-1" b="b-val"/> 
<row a="val-a-2" b="b-val"/> 
<row b="b-val" a="val-a-1"/> 
<row a="val-a-2"/> 

and this basically gives me a fourth group using the code above 

So I want to make sure that the attributes order can be controlled when I prepare the group-by, but any sorting attempt I make, leads to the group-by no longer being motionless 

I would welcome your suggestions 


Met vriendelijke groeten, 
Best regards, 

Geert Bormans 

Current Thread