Re: [xsl] passing intermediate result while recursively building nodeset

Subject: Re: [xsl] passing intermediate result while recursively building nodeset
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 9 May 2002 23:02:55 +0100
Hi Paul,

> I believe I understand your solution, but to my adled brain it
> appears as if I'm merely substituting a node set for a string, and
> I'll still confused as to how to access the nodes that I'm creating
> along the way.
>
> I'm also afraid I've done a poor job of explaining what I'm after,
> so let me try again ...
>
> Following your suggestion, I take my string (say, "NO BRAIN LEFT")
> and tokenize it:
>
>     <token>NO</token>
>     <token>BRAIN</token>
>     <token>LEFT</token>
>
> and then I have a template that matches "token". Each matching of
> the "token" template results in the creation of a relatively complex
> element (say an "x" element). But to complicate matters, the value
> of an "x" element can not be *solely* determined by looking at any
> (or all) of the "token" elements, its value is dependent upon the
> previously created "x" elements -- that is, when creating the i-th
> "x" element, I may need to look at the 1 thru (i - 1) "x" elements
> that were previously created. In addition, order is important; for
> example, the "x" element which was created in response to matching
> "<token>BRAIN</token>" will be the second element in the final node
> set.

I think that you have to describe for me what it is about the previous
"x" elements that you need to know. From what I recall, I was under
the impression that you needed to do something like count the
preceding tokens, so that you number each x element, or create some
kind of average over them or something. In other words, that having
the words as separate elements would give you easier access to them
through the preceding-sibling:: axis.

Could you describe some of the things that the you have to do with the
1 thru i-1 "x" elements so that I can give you more helpful advice?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread