Re: [xsl] Getting non-existing, but supplied, parameters

Subject: Re: [xsl] Getting non-existing, but supplied, parameters
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 13 Sep 2006 00:48:42 +0200
Hi Michael,

Thanks for your answer. See my additional comments.

Cheers,
Abel

Michael Kay wrote:
You might like to look at Andrew Welch's Kernow utility to see how it
tackles this. (I can't remember how it does, but I remember the discussion
about how it should).

https://sourceforge.net/projects/kernowforsaxon
I will look into this.
There are two possible ways to do it: one is to analyze the source
stylesheet, the other is to call


((Controller)transformer).getBindery().getGlobalParameterMap()
These appear to me as ways to get the defined parameters for a given stylesheet. I conclude from this that a similar mechanism from within the stylesheet itself is non-existent?
I think it's better to prompt the user for parameters that are actually
defined in the stylesheet, rather than trapping the fact that they supplied
unwanted parameters after the event.
I totally agree, and we actually do so (three months back you helped me out on getting global params). But we have three situations when things can still go wrong:

1. Getting the global params is not a foolproof way. Some parameters (i.e., when defaulting to a sequence, a calculation or node set), cannot be easily displayed and as a result are ignored. Still, users may override and supply these parameters.

2. About five parameters are mandatory for each stylesheet. These parameters are not shown to the users and are fixed. When supplying a new stylesheet, it is possible that the creator has a typo. There are several ways of dealing with this, and this was one option I am investigating.

3. Users can supply there own names of parameters, thus overriding settings from the server. This is done because complex (deep) imported stylesheets may not end up showing their parameters.

At present I don't think Saxon offers any interface that allows you access
to all the parameters that were supplied, as distinct from those that were
declared.
I see. If anybody would know, it'd be you ;)

Current Thread