This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Fwd: Over/under trimming of whitespace
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Cc: <www-xml-query-comments at w3 dot org>
- Date: Sat, 27 Apr 2002 20:17:37 +0100
- Subject: RE: [xsl] Fwd: Over/under trimming of whitespace
- Reply-to: xsl-list at lists dot mulberrytech dot com
> David Morris wrote:
> > I may be misinterpreting the XPATH spec, but it
> > says "The normalize-space function returns the argument string with
> > whitespace normalized by stripping leading and trailing whitespace
> > and replacing sequences of whitespace characters by a single space."
> >
> > I was expecting a single space and not an empty string
>
> I'm surprised no one noticed that before. The spec is a little
> ambiguous, isn't it?
A little informal perhaps, but I wouldn't have said it was ambiguous.
But I'm forwarding this to the public comments list as a request for the
spec to be clarified. Suggested wording:
The normalize-space function returns a string that is constructed by
applying the following changes to the argument string repeatedly until the
string is unchanged:
* if the string starts or ends with a whitespace character, that character
is removed from the string
* if the string contains two adjacent whitespace characters, that pair of
characters is replaced with a single space character (Unicode x20)
Michael Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list