Re: [xsl] Name of current mode

Subject: Re: [xsl] Name of current mode
From: "Christian Roth" <roth@xxxxxxxxxxxxxx>
Date: Mon, 19 Apr 2010 17:00:24 +0200
Mario Madunic wrote:

>Please post your solution as I'd be really interested in what the
>results are. I've never used tunneling myself and to be honest have
>completely forgotten about it since I first read about it.

Ken Holman has posted the solution already in this thread, which is
identical to how I would have done it (if I had done it that
way... :-)). Basically, you copy the mode into a tunnel parameter at the
first mode'd xsl:apply-templates and regardless of how many templates
lie in-between, in the template where you need the mode info again, you
can access it with via a tunnel param declaration. The tunnel="yes"
allows you to not have to explicitly pass that parameter in any of the
other templates that may be in-between in the calling chain.

Thanks to all who responded. I still think that a way to access the mode
information with an accessor would be a welcome enhancement of XSLT 2
and would help avoiding to maintain redundant information manually.

-Christian

Current Thread