Re: Grouping upon various attribute values
<foo a="a" b="b"/> and <foo b="b" a="a"/> are semantically equivalent but the result of string-join(@*,'-') would (I think, most of the time) be different, depends on the parser ,some routinely stuff attributes in some kind of hash table and so report them in an order unrelated to the order that they appear in the file. However Michael's observation is correct that in this case what matters is not that the attributes on the same element are reported in the same order, but that similarly named attributes on different elements are reported in the same order, and for that you need to sort. group-by="f:key(@*)" <xsl:function name="f:key"> <xsl:param name="nodes" as="item()*"/> <xsl:value-of separator="|"> <xsl:perform-sort select="$nodes"> <xsl:sort select="name()"/> </xsl:perform-sort> </xsl:value-of> </xsl:function>
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format