Subject: RE: Infinite Loop when param empty
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 23 Jul 2004 16:09:40 +0100
|
> I would NEVER want a parameter to be the result of the
> prinicpal source
> document if the user did not supply the parameter. I would
> ALWAYS want the
> parameter to default to an EMPTY node set if none was supplied.
then use select="/.." in 1.0, or select="()" in 2.0.
>
> ..and actually I think all node tests would fail even if a
> valid xml source
> was supplied to the above parameter. Example:
>
> <xsl:apply-templates select="$ENTRY_TEMPLATE"/> (would fail??).
>
No, the select expression is ignored if the parameter value is supplied.
(Well, at any rate, the *value* of the select expression is ignored).
XSLT 2.0 might give you a type error (because the default value is a string,
not a node-set), but 1.0 shouldn't.
Michael Kay
|