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

RE: Request for yet another function - truncating trailing spaces for string values

From: Michael Kay <mhk@mhk.me.uk>
Date: Thu, 16 Sep 2004 22:27:47 +0100
To: <pgp.coppens@pandora.be>, <public-qt-comments@w3.org>
Message-ID: <E1C83nh-0003ri-22@frink.w3.org>
An observation: I imagine that in many cases if trailing spaces are not
significant then leading spaces (and multiple internal spaces) won't be
significant either, so normalize-space() will do the job.
Michael Kay


From: public-qt-comments-request@w3.org
[mailto:public-qt-comments-request@w3.org] On Behalf Of Peter Coppens
Sent: 16 September 2004 21:39
To: public-qt-comments@w3.org
Subject: Request for yet another function - truncating trailing spaces for
string values

I fully understand that the period for 'functional' comments on the spec is
closed, but as this is information from the 'implementation trenches', just
perhaps a few cycles of some working group member can be diverted for a
I think that for a subset of environments (e.g. those that use XQuery to
query existing relational information) it would be beneficial to have a
function that removes trailing spaces from a string value (as in SQL's rtrim
The reason is that fixed character RDBMS columns end up being mapped (per
the SQL 2003 spec) with trailing spaces where needed. That's nice, as it
fully exposes the available RDBMS information, but often these trailing
spaces have no real meaning for the application.
The only solution we could find to remove these trailing spaces based on the
currently available F&O's is through something like fn:replace ( 'abc ', '
*$', ''). The need to fall back on regular expressions (often not available
in the different SQL implementations) seems overkill for such a simple an
most likely often needed operation. 
Of course we are free to define our own non-standard function and of course
people should not put varying length data in fixed length character columns,
but the case in favour for such a function nevertheless seems strong enough
for me to bother you with this.
Received on Thursday, 16 September 2004 21:28:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:59 UTC