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

Re: controller stylsheet. performance, best practices

Subject: Re: controller stylsheet. performance, best practices question
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Thu, 24 Apr 2003 13:22:48 +0200
stylsheet
"Braumüller, Hans" <H.Braumueller@xxxxxxxxxxxx> wrote in message
news:EB6EC71285FAC6469C0F41B476F5AAA1026B66@xxxxxxxxxxxxxxxxxxxxxxxxxxx

> I cannot figure out how the template xyzPage with mode="switch" is getting
involved when i call
>
> from template match="/" following in my switch.xml parameter p with xyz:
>
> <xsl:apply-templates
> select="document('switch.xml')/switch/*[name()=$p]">
>   <xsl:with-param name="current-node" select="."/>
> </xsl:apply-templates>
>

I think Mike meant:

<xsl:apply-templates mode="switch"
  select="document('switch.xml')/switch/*[name()=$p]">
  <xsl:with-param name="current-node" select="."/>
</xsl:apply-templates>



> Then i am in node xyz in switch.xml
>
> I do not see how template xyzPage with mode="switch" is applied then
> ?

if there is only one template that matches an "xyzPage" element, it will be
instantiated by the code above.

The code above achieves instantiating a template dynamically based on the
node that is matched by it. The node name itself is passed as a parameter.

So, instead of writing an unlimitedly long <xsl:choose> and having to update
it with new cases every time a new template is added, the code above does it
just in 4 lines -- once and forever.

This is the idea -- in case it is not clear there's a more detailed
explanation and many, many examples at:

http://fxsl.sourceforge.net


=====
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.