xsl-list
[Top] [All Lists]

Re: [xsl] name of the current mode

2009-11-14 14:28:21
At 2009-11-14 20:25 +0100, Stefan Krause wrote:
is there any way to detect the name of the current mode during the
processing of the input document? I tried a approach over several
matching templates for each mode:

<xsl:function name="test:detect-mode">
        <xsl:variable name="temp_element" as="element()">
                <test:detect/>
        </xsl:variable>
        <xsl:apply-templates select="$temp_element" mode="#current"/>
</xsl:function>

<xsl:template match="test:detect" mode="#default">#default</xsl:template>
<xsl:template match="test:detect" mode="Mode_A">Mode_A</xsl:template>
<xsl:template match="test:detect" mode="Mode_B">Mode_B</xsl:template>
<xsl:template match="test:detect" mode="#all"
priority="-1">#not_detected</xsl:template>

Unfotunately, this only works if I know all possible modes in advance.

But I think it is all you have available to you to try. I know of no way to expose the current mode.

. . . . . . . . . . . Ken


--
Vote for your XML training:   http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>