Re: [xsl] Processing approach

Subject: Re: [xsl] Processing approach
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Jul 2017 14:07:01 -0000
> I have a template that matches nodeC based on its ID, copies it contents and
appends child nodes.
> Its at this time that much info gets derived which is useful elsewhere.

In XSLT 1.0 there are a couple of approaches to this:

(a) put both the primary and secondary results into a variable, and then
process this using the node-set extension

(b) put both the primary and secondary results in the result tree of the
transformation, and then post-process this in a second pass

(these aren't actually very different: in both cases you're doing a pipeline
of two transformations, the only difference is whether it's done all within
one stylesheet or using separate stylesheets).

In XSLT 3.0 (or as vendor extensions) there's a range of options:

(a) memo functions: allow you to call a function twice, and the second time,
the results are remembered from the first time.

(b) accumulators: similar to memo functions in that the result of a function
can be used repeatedly without recomputation, but geared to the situation
where the value of the function for each node is computed incrementally as you
walk through the tree.

(c) maps: a function can in effect return multiple results, by returning a

Michael Kay

Current Thread