[xsl] What's evaluated first: @select or xsl:with-param?

Subject: [xsl] What's evaluated first: @select or xsl:with-param?
From: "Vladimir Nesterovsky" <vladimir@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Oct 2010 08:19:41 -0700
Hello!

I've seen a code like this:
----------
<xsl:variable name="a" as="element()?" select="..."/>
<xsl:variable name="b" as="element()?" select="..."/>

<xsl:apply-templates select="$a">
  <xsl:with-param name="b" tunnel="yes" as="element()" select="$b"/>
</xsl:apply-templates>
----------

It fails with an error:
"An empty sequence is not allowed as the value of parameter $b".

What is interesting is that the value of $a is an empty sequence,
so the code could potentially work, provided processor evaluated $a first,
and decided not to evaluate xsl:with-param.

Whether the order of evaluation of @select and xsl:with-param is specified 

by the standard or it's an implementation defined?

Current Thread