W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2004

RE: [XQuery]&[F&O] fn:error: function parameters

From: Ashok Malhotra <ashok.malhotra@oracle.com>
Date: Tue, 28 Sep 2004 14:57:14 -0700
To: Andrey Fomichev <fomichev@ispras.ru>, public-qt-comments@w3.org
Message-ID: <20040928145714590.00000002472@amalhotr-pc>
Andrey:
The WGs discussed your request on the telcon today.  Since, as a rule, we do not overload function
signatures we cannot have one signature for fn:error that takes a single QName and another that takes
a single string.  So, we decided to change the third and fourth signatures of fn:error and make the
QName optional.  In these two cases, if you pass the empty sequence as the first (QName) argument
the function behaves as if you had passed the QName corresponding to err:FOER0000 -- Unidentified Error.

Please let us know if this is satisfactory.

All the best, Ashok


-----Original Message-----
From: public-qt-comments-request@w3.org [mailto:public-qt-comments-request@w3.org]On Behalf Of Andrey Fomichev
Sent: Friday, September 03, 2004 1:06 AM
To: public-qt-comments@w3.org
Subject: [XQuery]&[F&O] fn:error: function parameters



Hello!

According to F&O fn:error function must have the first parameter of
type xs:QName if it has any. For example, fn:error with only one
parameter has the following signature:

fn:error($error as xs:QName) as none

But '2.5.2 Handling Dynamic Errors' section of [XQuery] gives the 
following example of using fn:error

fn:error(fn:concat("Unexpected value ", fn:string($v)))

So, fn:error is called with the value of type xs:string. Sometimes, 
strings are castable to xs:QName, but it's not this case...

So, is it an error in specification?
As I think, providing function 

fn:error($error as xs:string) as none

will be quite useful for various applications of XQuery.

Best regards,
Andrey




Received on Tuesday, 28 September 2004 21:58:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:34 GMT