xsl-list
[Top] [All Lists]

Re: [xsl] Equal rights for xsl:next-match & co

2013-05-17 14:29:08
xsl:next-match and xsl:apply-imports are always applied for the current mode, because if a rule was in a different mode it would never have matched and so can't very well be said to be the next-matching rule.

What bugs me is that you can't call <xsl:next-match/> inside <xsl:for-each> (because the "current template rule" is considered to be nullified).

Maybe in XSLT 3.0 they'll remove this restriction, because it would sometimes be useful to fan out to <xsl:next-match/> via <xsl:for-each>. On at least two occasions, I've tried to write it and then was reminded of the restriction. That's why this subject line caught my attention, because I agree with the sentiment. :-)

Evan

On 5/17/2013 11:44 AM, Ihe Onwuka wrote:
On Fri, May 17, 2013 at 7:29 PM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
xsl:next-match returns the next template in match priority order, so
changing the mode doesn't really make sense there.  If you need to do
that, just do <xsl:apply-templates select="." mode=" the other mode"/>

It's not about changing to some other mode. It's about whether
<xsl:next-match> should respect the modality of the  "calling
template" when looking for a matching template rule.
It does doesn't it?   I'm not in a position to check at the moment,
maybe you could post a small complete runnable example.

I don't know if it does. The XSLT 2.0 programmers reference makes no
mention of modes when discussing  next-match and apply-imports.

The scenario hasn't yet arisen in what I am doing but it is
sufficiently proximate for the question to arise.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--