I agree this would be a useful addition to the spec. I
can't think of any reason why it's not in there. I don't think it's been
requested. I don't know why I didn't push for it myself - I just put it down to
being too busy - as you probably know, there's a Saxon extension to provide a
It's unlikely to make it in now - new features are pretty
well banned. But you could raise it as a public comment anyway - it's a good
time to get things on the list for v2.
Although this post does not relate to Saxon directly,
it does deal with XQuery and since you have demonstrated a deep knowledge and
understanding of the spec, I thought I'd ask it here. If you feel that this
question would be better directed to another forum, could you point me in the
Do you have any
insight as to why the XQuery spec doesn't allow variables with
'external' to be declared with an initial value? "If the variable declaration
includes the keyword external, a value must be provided for the variable by
the external environment before the query can be evaluated."
XSLT provides this facility for it's parameter
declarations: "[DEFINITION: A top-level xsl:param element declares a
stylesheet parameter. A stylesheet parameter is a global variable with the
additional property that its value can be supplied by the caller when a
transformation is initiated.]"
Having this facility in XQuery would be tremendously
useful for all the same reasons that being able to override an XSLT stylesheet
parameter is useful.