Re: [xsl] Group-by attribute to appear as child of xsl:fork

Subject: Re: [xsl] Group-by attribute to appear as child of xsl:fork
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Aug 2016 15:39:08 -0000
> On 19 Aug 2016, at 16:26, Mailing Lists Mail daktapaal@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> I searched for examples for this.. apparently saxon has this but i could
find info onhow to use
>

There's an example in the spec at

http://www.w3.org/XML/Group/qtspecs/specifications/xslt-30/html/Overview-diff
.html#splitting-examples

(section 16.2, second example entitled "Splitting a Transaction File by
Customer Account".)

We've started implementing this in Saxon; the implementation and testing are
quite limited so far, but you're welcome to try it out.

The example in the spec creates a result-document for each group, and the
thinking is that a smart implementation could append each item from the input
directly to one of the output files as soon as its grouping key is calculated.
If you do anything other than creating a result document, it's likely that the
results from processing each group will be buffered in memory so they can be
assembled in the right order when the entire input has been read.

Michael Kay
Saxonica

>
> On Aug 19, 2016 11:03 AM, "Mailing Lists Mail daktapaal@xxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> I am reworking my xslts and i have seen that i am using
> <xsl:for-each group select = "AnimalKingdomGroup/copy-of(.)" group-by =
"groupName"/>
> When i remove the template that does this , the end tags are copied fine.
> I am thinking there should be something about the grouping . what is the
best way to do this ? If i don't put copy of, then i know its an error that i
am accessing the tree twice in same context.
>
> But copy-of is also bad because animalKingdomGroup will be massive and i
know that .
> Any advices here ?
> Thanks.
> Dt
> Ps: i am also making a repro of my code to upload in saxon bug list..
>
> >
> >
> > On Aug 18, 2016 11:57 AM, "Michael Kay mike@xxxxxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> >>
> >> Your stylesheet may be exhibiting the same bug as listed on our web site,
or it might be a different bug with similar symptoms. Give us the details, and
we'll be happy to check it out. It could turn out be something completely
different, like a failure to close the output stream. When we know what it is,
we can start looking for a workaround.
> >>
> >> We are always looking for more test cases, so please feel free to submit
the problem case in a form that we can run.
> >>
> >>
> >>> On 18 Aug 2016, at 15:25, Vasu Chakkera vasucv@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> >>>
> >>> So, i can assume that the stylesheet that works once under will always
work...
> >>>
> >>>
> >>
> >> Not always. Some problems are due to multi-threading, or to other effects
like hashing that effectively randomise the order of execution, so don't
always repeat the same way. But you'll spot that fairly quickly if you are
disciplined about running repeatable and automated tests of your code.
> >>
> >> Michael Kay
> >> Saxonica
> >> XSL-List info and archive
> >> EasyUnsubscribe (by email)
>
> XSL-List info and archive
> EasyUnsubscribe (by email)
> XSL-List info and archive
> EasyUnsubscribe (by email)

Current Thread