[xsl] name of the current mode

Subject: [xsl] name of the current mode
From: Stefan Krause <stf@xxxxxxxx>
Date: Sat, 14 Nov 2009 20:25:36 +0100
Hello,

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.

Best regards,

Stefan

Current Thread