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

Re: dynamically change modes based on parameters? have

Subject: Re: dynamically change modes based on parameters? have default modes? how? short code examples please :)
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 12 Sep 2003 07:06:47 +0200
dynamically change xsl
"SANWAL, ABHISHEK (HP-Houston)" <abhishek.sanwal@xxxxxx> wrote in message
news:24B68DDCFD49004882CD8D02D2E4338AFFD0E1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Yes. But I am having a bad time trying to use and push parameters
> through other templates. Of course, I know now the way to "play" with
> XSL.
>
> But there is one important question.
>
> There are multiple layouts I have inside these nested templates and I
> need to conditionally apply certain kind of layouts using some
> parameters. Now I am not sure if I can dynamically change the MODE that
> applies for the next "nested" call to a template ( like this. )
>
> <xsl:apply-templates select="./SectionBody"
> mode={$SectionBodyModeParam}/>
> <xsl:apply-templates select="./Paragraph" mode={$ParagraphModeParam}/>
>
> Is this possible?

No. The value of the "mode" attribute must be a QName -- that is, among
other things, it must be statically known at compile-time.


The way to dynamically decide which tempalte to instantiate, based on
parameters, is the base for the FXSL library -- read about this at:


http://fxsl.sourceforge.net/articles/FuncProg/Functional%20Programming.html

and


http://www.idealliance.org/papers/extreme03/xslfo-pdf/2003/Novatchev01/EML2003Novatchev01.pdf


One particularly elegant way to deal with parameters scoping is by using
partial application -- described in the second reference above.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.