[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] "Tunneling" a parameter in document order

Subject: Re: [xsl] "Tunneling" a parameter in document order
From: Christian Roth <roth@xxxxxxxxxxxxxx>
Date: Fri, 13 Apr 2012 10:31:38 +0200

Hi Andrew,

> As I asked for the sample I should probably just say: that example is
> way too complicated for me, it would require investing a fair amount
> of time just to understand the requirement.

that's why I did not give an example in the first place :-) A simpler example,
unfortunately, would not be "covering the various possibilities".

As for the basic requirement, I tried to describe it with: "Keeping a global
variable's value current while doing a depth-first traversal of a document,
where the variable's value is not scoped by either the document's element
hierarchy, nor the nesting of XSLT template calls."

I'll try in a different way: Imagine someone has laid a rope along the path of
a depth-first traversal of the document tree. The initial color of the rope is
red. However, any node in the tree may decide to change its color (e.g. to
green), which the rope then has from the start of that node on for all later
(=following::) ones until we reach the document end, or up to the next node
that chooses to change the rope's color again. All nodes along the path can
query the rope's color (that's the parameter I need to 'tunnel' through the
document in document order) it has when it reaches them.

Which new color a node changes the rope's color to depends on its context
and(!) the current color of the rope it has when it reaches it.

I don't know how to better describe the problem without confusing you even

Regards, Christian

Current Thread