xsl-list
[Top] [All Lists]

Re: [xsl] passing a sequence as a parameter

2008-02-26 08:11:03
Sorry for all the confusion ...

Thanks Colin for the clarification.

On Tue, Feb 26, 2008 at 8:10 PM, Colin Adams
<colinpauladams(_at_)googlemail(_dot_)com> wrote:
On 26/02/2008, Mukul Gandhi <gandhi(_dot_)mukul(_at_)gmail(_dot_)com> wrote:
Hi Colin,

Hello Mukul,

 On Tue, Feb 26, 2008 at 5:06 PM, Colin Adams
 <colinpauladams(_at_)googlemail(_dot_)com> wrote:
 > Whether or not you can pass a sequence depends upon the processor. You
 > can do this with Gestalt, as it allows you to pass any XPath
 > expression. But you can't specify the type on the xsl:param with the
 > as attribute, which is unfortunate.

 I think, it's logical not to have type specification (with, as
 attribute) on xsl:param instruction. We pass parameters to the
 stylesheet from outside, and making the input environment XSLT/XPath
 type aware doesn't appear logical to me.

I don't understand what you are saying.
Xsl:param can take an as attribute. If the valued passed in does not
match up to this type, then you get err:XTTE0590.

What I was talking about was that you cannot specify something like
as="(xs:boolean, xs:boolean, xs:integer)".

With a schema-aware process, you could specify a user-defined type,
which would do the trick. But not being very knowledgable about
schema-aware processing, I am not clear as to which schema would be
searched for global paranmeter checking.
In any case, Gestalt is not schema-aware, which is what I was getting
at. Sorry for not being clearer.

As currently happening, whatever that is passed to the stylesheet to
xsl:param variables, can be casted in the stylesheet to an appropriate
type. I think, this is the correct design

Well I don't. There is no reason why the author of the stylesheet
should have to implement XPath parsing.

A solution is to pass in each memeber of the sequence as a separate
typed variable. This relies on be able to pass XPath values as
parameters. It will work with Gestalt and any other processor that has
such a facility.

Another solution that will work with a schema-aware processor is to
pass a URI to a parameters document, and have it validated. This is
much more clumsy from the point of view of the user of the interface
to the processor.

Best would be able to say:

as="(xs:boolean, xs:boolean, ...)"



-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--