Subject: Re: [xsl] Question on streaming and grouping with nested keys From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 14 Jul 2017 12:41:55 -0000 |
I tried the example from Martin with
<xsl:template match="TRANSACTION-LIST">
<xsl:copy>
<xsl:for-each-group select="copy-of(TRANSACTION)" group-by="ITEM2/SUBITEM2/GROUPING-KEY">
<xsl:copy>
<item1-sum><xsl:value-of select="sum(current-group()/ITEM2/SUBITEM2.1)"/></item1-count>
...
It gives me an of memory error. The input file is 160MB, but the individual transactions are rather small (around 20+ elements). The error also appears if I remove "<xsl:copy>".
I have a working solution using an accumulator and maps, see below, but here I did not manage to use streaming. If I set the accumulator to streamable="yes", Saxon EE tells me
"The xsl:accumulator-rule/@select expression for a streaming accumulator must be motionless"
Although I am using xsl-copy() as in Martin's example.
<xsl:accumulator name="gather-values" as="map(xs:anyAtomicType, node())" initial-value="map{}">
<xsl:accumulator-rule match="TRANSACTION">
<xsl:variable name="current" select="copy-of()"/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Question on streaming and, Felix Sasaki felix@x | Thread | Re: [xsl] Question on streaming and, Michael Kay mike@xxx |
Re: [xsl] Question on streaming and, Felix Sasaki felix@x | Date | Re: [xsl] Question on streaming and, Michael Kay mike@xxx |
Month |