[xsl] RE : [xsl] recursivity and param

Subject: [xsl] RE : [xsl] recursivity and param
From: "Xavier Boully" <xavier.boully@xxxxxxxxxxxxxxxx>
Date: Thu, 12 Aug 2004 14:21:05 +0200
> When writing your XSLT it's
best to assume that you are
writing for a massively
parallel system
> that is going to evaluate
all the templates on child
nodes at the same time, return
the
> results in some random (in
time) order, and then this
template assembles the results
as they
> come in and writes out the
result for this template based
on document source order,
> irrespective of the order in
which the templates applied to
children were executed.

> It is just possible that in
fact that isn't what happens
and that you have a serial
machine and
> your processor always
executes templates in an order
derived from the document
order of input
> nodes, but that is an
implementation detail than can
never affect the programming
constructs.

> So you see it isn't possible
for a template to say "I'm the
10'th to be processed" and
stop the
> processing of other
templates. If the language did
allow it you would get
arbitrary results
> depending on teh order in
which teh system happened to

I see the argument. You are
right. It is not possible to
ask for an evaluation of a
template that applies to a set
of nodes with the hope to
collect the results in a known
order.

> If that's what you want to
do, just select 10 such nodes,
rather than select them all
and then
> try to make the 10'th stop
processing.

I am sorry my example was too
simple to give an idea of my
exact need. Decision about an
element doesn't depend only on
the condition of being in the
10 first, but is dealing with
several conditions global ones
and local ones. Sometime
decision to take is not about
an element but about a string
in a text node.
So far I am not able to write
those conditions in the select
of an apply-templates and that
is why I was thinking of using
with-param to apply templates
on children.
But your explanation above
ruins the idea to apply a
template on a set of children.

Current Thread