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

Re: initial template parameters

Subject: Re: initial template parameters
From: Max Toro <maxtoroq@xxxxxxxxx>
Date: Thu, 18 Mar 2010 10:39:59 -0400
Re:  initial template parameters
> more portable you can have a simple stylesheet with just a named template
> that initialises its parameters from global parameters and then xsl:imports
> the original stylesheet. this means you need a wrapper stylesheet for any
> top level named template that you want to use, but most stylesheets don't
> have _so_ many choices for initial named template.

Yes, I though of this solution too, but seems like too much trouble.

About stylesheets not having many entry point choices, I think this
limitation helps to enforce that stylesheets have a single purpose,
while they could have many purposes based on related functionality.
Like object-oriented languages, you can call a class constructor
passing parameters (global parameters in XSLT) and then call a method
passing other parameters (initial template parameters).
--
Max

2010/3/18 David Carlisle <davidc@xxxxxxxxx>:
> On 18/03/2010 14:13, Max Toro wrote:
>>> more portable you can have a simple stylesheet with just a named template
> that initialises its parameters from global parameters and then xsl:imports
> the original stylesheet. this means you need a wrapper stylesheet for any
> top level named template that you want to use, but most stylesheets don't
> have _so_ many choices for initial named template.
>> The only solution I can think of is using extension methods to pull
>> the parameters from the environment, something like this:
>>
>> <xsl:param name="color" value="(ext:get-parameter('color'), 'red')[1]"
>> as="xs:string"/>
>

>
> David
>
> ________________________________________________________________________
> The Numerical Algorithms Group Ltd is a company registered in England
> and Wales with company number 1249803. The registered office is:
> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
>
> This e-mail has been scanned for all viruses by Star. The service is
> powered by MessageLabs.
> ________________________________________________________________________

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.