Re: [xsl] Re-visiting a Child Node

Subject: Re: [xsl] Re-visiting a Child Node
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 10 Apr 2001 00:02:20 +0100
Hi Daniel,

> The second call to RetrieveNameAndAddressRSResponse wipes everything
> that came before it. How can I revisit this part of the tree without
> the page erasing the previous code?

It *looks* as though you're suffering a fundamental misunderstanding
about how XSLT works. In your code you have two templates that match
RetrieveNameAndAddressRSResponse elements, and you seem to be
expecting that they are applied in turn.

That's not how XSLT works. In XSLT, the processor visits nodes
within the node tree, and for each of the nodes, it tries to find
*the* template that matches that node, and then follows the
instruction in that template.  If you have two templates that have
exactly the same match pattern (the content of the 'match' attribute),
then the one that appears last in your stylesheet is the one that will
be used.

So it's not that the second template wipes over what's generated from
the first template, it's that when the
RetrieveNameAndAddressRSResponse element has templates applied to it,
both templates match it, but the processor can only apply one so it
applies the last one in the stylesheet.  The first template never gets
applied at all.

I'm not completely clear on what you're trying to get out - why the
dynamic XPath stuff is necessary for your problem. It would be really
helpful if you would post an example of the table that you want to
get, so that we can look at various ways of getting it.

If you really need dynamic XPath evaluation, then you might want to
see whether your processor can help - it might support an evaluate()
function (e.g. saxon:evaluate()) or allow you to write a user-defined
function that can do the same kind of thing (e.g. through DOM
manipulation in MSXML).

Cheers,

Jeni

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



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


Current Thread