xsl-list
[Top] [All Lists]

RE: [xsl] Calculating cumulative values - another call for help

2007-08-29 08:54:27
Andrew,

Thank you again.

Are the terms "micropipeline", "multiple passes" and "multiphase
transformation using temporary trees" all essentially equivalent?

Simon

-----Original Message-----
From: Andrew Welch [mailto:andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com] 
Sent: August 29, 2007 1:40 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Calculating cumulative values - another call for help

On 8/29/07, Simon Shutter <simon(_at_)schemax(_dot_)com> wrote:
Dear Experts,

I've been aggregating numbers in XSLT 1.0 using the 
preceding-sibling:: axis for nodes with the same parent.  I now need 
to aggregate all the values that precede the context node, even if 
they have different parents.  For this I added another attribute using 
the preceding:: axis (see XSLT 1.0 Stylesheet below).  Unfortunately, 
the transform is starting to groan under the weight of all these 
O(n^2) operations.  I have revisited an earlier solution suggested by 
Dimitre Novatchev (see XSLT 2.0 Stylesheet below) that uses FXSL.  
However, I'm not clear how I can adapt it to meet the new requirements.
Specifically, I would like to:

a) generate attribute y3 that is a cumulative value based on all 
preceding <point> elements
b) copy y1 from the input to the output

- If you can use XSLT 2.0 then just do it in two passes
- If you are stuck with 1.0 without the node-set extension then you could
optimize it a little by processing <point> elements along the
following-sibling axis passing the running total as you go (but that would
require @x to have a limited number of possible values)
- If you are using 1.0 + node-set extension then again just do two passes to
avoid O(n^2)

cheers
andrew
--
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--