[F&O] Function root() and static typing

fn:root() is defined as follows:

"14.1.9 fn:root
fn:root() as node() 
fn:root($arg as node()?) as node()? "

The examples in 14.1.9.1 end with the following sentence:

"Note:

We could make the final three examples type-safe by wrapping their
operands with fn:exactly-one()."


This is the correct way to define a function without sacrificing its type
definition by allowing node()* as done elsewhere (see my comments in this
list on this anomaly in the definition of min(), max() and avg()).


I want to congratulate the authors for the correct definition and examples
of fn:root().

I strongly recommend that all other function definitions, in which the
type definitions are severely underspecified by allowing node()* or 
item()* (and which alters the normally accepted behaviour of these
functions and makes them less meaningful and actually defeats the purpose
of type-checking) be defined properly as this is done with the function
fn:root().


Once again -- congratulations for the correct function definition.

Thank you.

Dimitre Novatchev.





__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

Received on Thursday, 27 November 2003 14:25:12 UTC