Re: [xsl] Optimization/error reporting: cardinality checks & function calls

Subject: Re: [xsl] Optimization/error reporting: cardinality checks & function calls
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 24 Jan 2006 06:59:34 +1100
> I think the understanding is meant to be that an implementation is free to
> skip "evaluation" of an argument, and that the cardinality check is also
free
> to be skipped if the argument as a whole has been skipped.
>
> Am I right in my interpretation?

It seems to me that the return type of the function cannot be
determined without knowing the cardinality of the function -- due to
the fact that different overloads can have different return types.

Therefore, as cardinality would be necessary in general, it cannot be
skipped or ignored.


--
Cheers,
Dimitre Novatchev
---------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all.



On 1/24/06, Frans Englich <frans.englich@xxxxxxxxx> wrote:
>
> Hi all,
>
> I'm a bit confused about errors & optimizations in XPath/XQuery
> implementations, perhaps someone could help me clear it.
>
> 2.3.4 Errors and Optimization in XML Path Language (XPath) 2.0 says that
> implementations are free to perform arbitrary optimizations(such as
skipping
> evaluation of somekind) as long as 1) The result is identical to when not
> being optimized, except for that errors are possibly not reported; and 2)
> that cardinality errors are still reported.
>
> Section 2.3.4 uses the term "expression", and I presume functions are
> applicable to that discussion(functions are expressions).
>
> Further, in 3.1.5 Function Calls, one can read this:
>
> <quote>
> Argument expressions are evaluated, producing argument values. The order of
> argument evaluation is implementation-dependent and a function need not
> evaluate an argument if the function can evaluate its body without
evaluating
> that argument.
> </quote>
>
> I think the understanding is meant to be that an implementation is free to
> skip "evaluation" of an argument, and that the cardinality check is also
free
> to be skipped if the argument as a whole has been skipped.
>
> Am I right in my interpretation?
>
>
> Cheers,
>
>                Frans

Current Thread