On Tue, Jul 8, 2008 at 5:19 AM, Ying Zhang
You probably mean PFty_empty().
This might indeed be the type we are looking for, however, in the final generated MIL code, it contains no translation for fn:put() at all. The simplification/optimization steps didn't know that this "senseless" function has some side effect:)
I will try to find where fn:put has been simplified, or maybe Jan already has an idea?
Hi! empty-sequence() doesn't seem to be the right return type for fn:put(). Pathfinder decides the validity of updating expressions slightly different than the W3C specs (and, in my eyes, much more consistent). According to the W3C, updating expressions have the return type empty-sequence() and there are syntactical constraints that prohibit mixtures of updating and non-updating expressions. Pathfinder, by contrast, knows an additional type, separate from any other type: statement (accessible via PFty_stmt() or something like that). Correctness of a query is then decided based on types. This should also be the right return type for fn:put(). The W3C specification even seems somewhat contradictory. According to static typing rules, most situations where an expression can statically be determined to yield the empty sequence are actually considered a type error. In consequence, there must not be a function whose return type is empty-sequence(). Pathfinder doesn't strictly implement this part of the static typing feature. Best regards, Jens -- Jens Teubner, jens.teubner@gmail.com