Subject: Re: [xsl] Re: XPath expression that yields the same resultasxsl:for-each-group? From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 31 May 2019 06:36:28 -0000 |
the groups in an XSLT variable:
Group the rows using the composite key ARPT__IDENT | TRM__IDENT and store
<xsl:variable name="groups" as="array(element(row))*" select="
let $keys :=
distinct-values($rows/concat(ARPT__IDENT, '|', TRM__IDENT))
return
for $i in $keys
return
array {$rows[$i = concat(ARPT__IDENT, '|', TRM__IDENT)] }
Note that you can also create such a sequence of arrays where each array contains the items belonging to a group with
B B B B B B B <xsl:variable name="groups" as="array(element(row))*"> B B B B B B B B B B B <xsl:for-each-group select="$rows" composite="yes" group-by="ARPT__IDENT, TRM__IDENT"> B B B B B B B B B B B B B B B <xsl:sequence select="array { current-group() }"/> B B B B B B B B B B B </xsl:for-each-group> B B B B B B B </xsl:variable>
That will probably perform better than the pure XPath expression based grouping (that does nothing more than apply the old XQuery 1.0 "grouping" technique to collect distinct-values first as a means to select items of each group).
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: XPath expression that yie, Costello, Roger L. c | Thread | |
[xsl] Re: XPath expression that yie, Costello, Roger L. c | Date | [xsl] [ANN] Balisage Call for Late-, B Tommie Usdin btusd |
Month |