[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: XPath expression that yields the same resulta

Subject: Re: 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
Re:  Re: XPath expression that yields the same  resulta
Am 30.05.2019 um 23:46 schrieb Costello, Roger L. costello@xxxxxxxxx:

Group the rows using the composite key ARPT__IDENT | TRM__IDENT and store
the groups in an XSLT variable:

<xsl:variable name="groups" as="array(element(row))*" select="

let $keys :=

distinct-values($rows/concat(ARPT__IDENT, '|', TRM__IDENT))


for $i in $keys


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


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.