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

Thanks. 

I personally have to admit however, that I find the type signature of
fn:root() completely and utterly useless and underspecified. If you
happen to have exact knowledge about the type of the root node (e.g., if
you provide external type information for the document type you operate
on when executing /a/b), you do not want to get such a generic type.

So while we deal with the cardinality issue, we have (I think) some
other issues with this function.

Best regards
Michael

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Dimitre Novatchev
> Sent: Thursday, November 27, 2003 11:23 AM
> To: public-qt-comments@w3.org
> Subject: [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 Friday, 28 November 2003 03:16:30 UTC