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

Re: [FO] fn:substring arguments

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Sun, 23 Nov 2008 17:07:54 +0530
Message-ID: <7870f82e0811230337u7c6f0187y56596d94a6b988c1@mail.gmail.com>
To: public-qt-comments@w3.org

I saw in the F&O spec, that fn:string-length() function returns value
of type xs:integer.

I think that string-length is semantically equivalent to $startingLoc
(as mentioned in my previous post below). I mean that $startingLoc is
always <= string-length.

Shouldn't it then be appropriate to make $startingLoc as xs:integer
(for the fn:substring function)?

On Sun, Nov 23, 2008 at 2:43 PM, Mukul Gandhi <gandhi.mukul@gmail.com> wrote:
> Hello,
>   The F&O spec defines the fn:substring function as,
>
> fn:substring($sourceString  as xs:string?,
>                  $startingLoc  as xs:double) as xs:string
>
> In the above method signature, the 2nd argument is a xs:double.
>
> Whereas in Java language, substring function of the String library
> accepts an "int" argument.
>
> What is the motivation for the F&O spec to define the startingLoc
> argument as, xs:double and not an integer?



-- 
Regards,
Mukul Gandhi
Received on Sunday, 23 November 2008 11:38:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:25 UTC