[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|