Re: [xsl] flatened hiearchies for xslt2

Subject: Re: [xsl] flatened hiearchies for xslt2
From: ac <ac@xxxxxxxxxxxxx>
Date: Thu, 08 Mar 2007 11:23:34 -0500
Hi Dimitri and everyone,

It now works fine.

Mind you, I understand the impacts of extreme hours ...

I tried checking the performance of your key-based approach against David's for-each-group approach, but at 21000 nodes (sections), I still cannot detect any difference and if there is one, it is still well under a second. In fact, the whole process which involves reading and merging (2 x 2) 120 source WBS files and writing 60 result WBS files, each with over 500 nodes and 360 tasks/sections to process, takes less than 2 seconds. To get more differentiating results will involve using a very large dataset. I wonder if the key approach would use more or less resources than the grouping approach. I am inclined to think that on a very large dataset, the key approach may be advantageous because of all the group creation implied by the other approach, unless Saxon performs some smart optimization. What do you think ?

Thank you again,
ac




Hmm, I usually reply to messages very early in the morning, possibly sometimes feeling sleepy.

Just change in my code:

<xsl:key name="kChildren" match="section"
  use="generate-id(preceding::section
                        [@level = current()/@level - 1]
                        [last()]
                   )"
/>

With:

<xsl:key name="kChildren" match="section"
  use="generate-id(preceding::section
                        [@level = current()/@level - 1]
                        [1]
                   )"
/>


and now you'd be getting the correct results.


Hope this helped.

Current Thread