[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: name of the current mode

Subject: Re: name of the current mode
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 14 Nov 2009 18:32:08 -0800
Re:  name of the current mode
> Unfotunately, this only works if I know all possible modes in advance.

You can write a generic transformation, that, given a specific
main/primary stylesheet module, traverses the graph of
included/imported stylesheet modules and collects all modes.

Then use this result to (again programmatically) generate all the
templates, needed to determine the current mode.

All the described processing will not require any manual activity.



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play




On Sat, Nov 14, 2009 at 11:25 AM, Stefan Krause <stf@xxxxxxxx> wrote:
> 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">
> B  B  B  B <xsl:variable name="temp_element" as="element()">
> B  B  B  B  B  B  B  B <test:detect/>
> B  B  B  B </xsl:variable>
> B  B  B  B <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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.