Subject: RE: Use of Select in Params
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 8 Mar 2007 08:13:40 -0000
|
> You know, the use of a select in param definitions has always
> confused me. Could someone explain them, maybe a simple
> example?
It's just a default value for use when the caller doesn't supply one.
> Also, the select for the param, does it have an
> effect on the data passed into it (if it is a node litst)?
No, if the caller supplies a value for the param then the select attribute
is ignored.
> I have frequently used "../" or is it "/.." to guarantee that
> the param should be interpreted as a node-list.
It doesn't give any such guarantee. The fact that the default value is of
one particular type doesn't stop the caller supplying a value of a different
type. In XSLT 2.0, declare the expected type using an "as" attribute.
Michael Kay
http://www.saxonica.com/
|