Subject: [xsl] Variable and parameter with same name and scope allowed in 2.0 From: "andrew welch" <andrew.j.welch@xxxxxxxxx> Date: Tue, 2 May 2006 13:59:19 +0100 |
<xsl:function name="f:f"> <xsl:param name="p"/> <xsl:variable name="p" select="concat($p, 'a')"/> <xsl:sequence select="$p"/> </xsl:function>
The same goes for named templates - a variable is allowed to have the same name as a parameter.
I can see how its possible - the variable will always come after the parameter, so it will always 'win' when it comes to scope. My concern is that this sort of thing would usually end up from a mistake, and then get silently handled by the code - it's shadowing, and its well known how many problems that can cause.
I've only tried this with Saxon 8.7.1 so I'm assuming it's intentional? Is there a good reason for this - something that I'm not seeing at the moment?
thanks andrew
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Partial sort of a schema-vali, Gierschner, Frank | Thread | RE: [xsl] Variable and parameter wi, Florent Georges |
RE: [xsl] Merging elements within a, Michael Kay | Date | Re: [xsl] Merging elements within a, David Carlisle |
Month |