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

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

From: Oliver Becker <obecker@informatik.hu-berlin.de>
Date: Wed, 25 Feb 2004 08:58:23 +0100 (MET)
To: Noe Michejda <noe_michejda@7thportal.pl>
Cc: Ashok Malhotra <ashokma@microsoft.com>, public-qt-comments@w3.org
Message-ID: <Pine.GSO.4.02.10402250847000.21594-100000@naxos>

> 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.

If you consider fn:substring-before('xxxxxxx','x') and
fn:substring-after('xxxxxxx','x') you wouldn't expect them to
return the same.
(Of course, otherwise we wouldn't need two different functions)

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

I think it is important, and even more, it is logical and conistent.

Let fn:substring-after($a,$b) return $c
Let fn:contains($b,$bb) return true
Then I do expect that fn:contains(fn:substring-after($a,$bb), $c) is true.
Don't you?

In other words: if $c follows $b and $bb is in $b then $c follows $bb.
So we would have to argue whether fn:contains($a,'') should return true.
I think it should.

Best regards,
Oliver
(not a WG member)
Received on Wednesday, 25 February 2004 02:58:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:06 GMT