Re: [F&O] 7.5.4 fn:substring-before

> Thank you for your comment.  We agreed to correct both the wording and
> the example on 7.5.4 as suggested in the joint WG meeting on Jan 19.
> Please let us know if this is satisfactory.

Basically I have feeling, that both fn:substring-before and
fn:substring-after
should return same value when called with zero-length string
- either zero-length string or unchanged first argument.

Returning first argument is little bit more natural for me.
But it's only feeling, I don't have any strong arguments for any of above.

Maybe small one, (but contrary to my previous suggestion): other string
functions returns
zero-length string, when called with empty-sequence as parameter, so maybe
fn:substring-after should do the same.

Anyway I don't think, that logic of having 'virtual' empty string at
beginning or end
of every string should be determinant here.

Best regards,
Noe Michejda
7th Portal S.C.


>
> All the best, Ashok
>
> -----Original Message-----
> From: public-qt-comments-request@w3.org
> [mailto:public-qt-comments-request@w3.org] On Behalf Of Noe Michejda
> Sent: Thursday, January 15, 2004 1:05 PM
> To: public-qt-comments@w3.org
> Subject: [F&O] 7.5.4 fn:substring-before
>
>
> F&O section 7.5.4 (definition of function fn:substring-before) states:
>
> "If the value of $arg2 is the zero-length string, then the function
> returns
> the zero-length string."
>
> But later example is given:
> "fn:substring-before("Baloney!","") returns "Baloney!". "
>
> Then 7.5.5 fn:substring-after states:
>
> "If the value of $arg2 is the zero-length string, then the function
> returns
> the value of $arg1."
>
> I think error in definition of fn:substring-before, behavior should be
> the
> same as in fn:substring-after.
> "If the value of $arg2 is the zero-length string, then the function
> returns
> the value of $arg1."
>
> If definition is correct and example mistaken, I think it is bad idea to
> return zero-length string in such case.
>
> Best regards,
> Noe Michejda
> 7th Portal S.C.
>
>
>

Received on Tuesday, 24 February 2004 19:54:22 UTC