[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:13:20 -0400
Re:  initial template parameters
Yes, if we can choose an entry point then why cannot we provide
parameters for it?
I think this restriction makes initial templates less useful, unless
we choose between a set of parameterless templates.

Using globals as defaults isn't really a solution, since that would
restrict the set of templates with parameters to choose from to one,
the one whose parameters are duplicated as global parameters.

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"/>

I suspect there isn't enough people concerned about this to get this
issue into the working group's todo list (sigh).
--
Max

2010/3/18 Michael Kay <mike@xxxxxxxxxxxx>:
>> "Parameters passed to the transformation by the client
>> application are matched against stylesheet parameters (see
>> 9.5 Global Variables and Parameters), not against the
>> template parameters declared within the initial template. All
>> template parameters within the initial template to be
>> executed will take their default values."
>>
>> Why? :-(
>
> Either because we were lazy, or because we wanted to keep things simple, or
> both. I think an interface in which you could supply both the values of
> stylesheet parameters and the values of parameters to the initial template
> might be confusing to many users. However, I can see why you want it:
> logically, the requirement makes sense.
>
> Regards,
>
> Michael Kay
> http://www.saxonica.com/
> http://twitter.com/michaelhkay

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.