W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2003

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

From: Michael Rys <mrys@microsoft.com>
Date: Fri, 28 Nov 2003 00:16:28 -0800
Message-ID: <EB0A327048144442AFB15FCE18DC96C701642DB2@RED-MSG-31.redmond.corp.microsoft.com>
To: "Dimitre Novatchev" <dnovatchev@yahoo.com>, <public-qt-comments@w3.org>

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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:15 UTC