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 14:13:23 -0000 |
2017-07-14 14:41 GMT+02:00 Martin Honnen martin.honnen@xxxxxx <mailto:martin.honnen@xxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx <mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>>:
On 14.07.2017 14:05, Felix Sasaki felix@xxxxxxxxxxxxxx <mailto:felix@xxxxxxxxxxxxxx> wrote:
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>".
160 MB doesn't sound like a file you need streaming for at all. Does
that suggestion above cause memory problems only when using
streaming (e.g. when you have <xsl:mode streamable="yes"/>) or also
without streaming?
Without streaming it works.
Thanks. Working without accumulators is fine, just trying to understand the issue. Other input files are a bit bigger, up to 1.5 GB, so having a streaming solution would be nice but it's not mandatory.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:map="http://www.w3.org/2005/xpath-functions/map" exclude-result-prefixes="xs math map" expand-text="true" version="3.0">
<?xml version="1.0" encoding="UTF-8"?> <TRANSACTION-LIST> <TRANSACTION> <ITEM1>1</ITEM1> <ITEM2> <SUBITEM2.1>10</SUBITEM2.1> <SUBITEM2.2> <GROUPING-KEY>a</GROUPING-KEY> </SUBITEM2.2> </ITEM2> </TRANSACTION> <TRANSACTION> <ITEM1>1</ITEM1> <ITEM2> <SUBITEM2.1>10</SUBITEM2.1> <SUBITEM2.2> <GROUPING-KEY>b</GROUPING-KEY> </SUBITEM2.2> </ITEM2> </TRANSACTION> <TRANSACTION> <ITEM1>1</ITEM1> <ITEM2> <SUBITEM2.1>10</SUBITEM2.1> <SUBITEM2.2> <GROUPING-KEY>c</GROUPING-KEY> </SUBITEM2.2> </ITEM2> </TRANSACTION> <TRANSACTION> <ITEM1>1</ITEM1> <ITEM2> <SUBITEM2.1>10</SUBITEM2.1> <SUBITEM2.2> <GROUPING-KEY>a</GROUPING-KEY> </SUBITEM2.2> </ITEM2> </TRANSACTION> <TRANSACTION> <ITEM1>1</ITEM1> <ITEM2> <SUBITEM2.1>10</SUBITEM2.1> <SUBITEM2.2> <GROUPING-KEY>b</GROUPING-KEY> </SUBITEM2.2> </ITEM2> </TRANSACTION> <TRANSACTION> <ITEM1>1</ITEM1> <ITEM2> <SUBITEM2.1>10</SUBITEM2.1> <SUBITEM2.2> <GROUPING-KEY>c</GROUPING-KEY> </SUBITEM2.2> </ITEM2> </TRANSACTION> </TRANSACTION-LIST>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Question on streaming and, Felix Sasaki felix@x | Thread | [xsl] HTML tables to CALS tables co, Love Kumar Sharma lu |
Re: [xsl] Question on streaming and, Felix Sasaki felix@x | Date | [xsl] Re: HTML tables to CALS table, Michele R Combs mrro |
Month |