[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Fwd: Over/under trimming of whitespace

Subject: Re: Fwd: Over/under trimming of whitespace
From: Mike Brown <mike@xxxxxxxxxxxxxxxx>
Date: Sat, 27 Apr 2002 00:46:56 -0600 (MDT)
xsl trimming whitespace
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? But the intended effect is the empty string,
if the original string consists of nothing but whitespace characters.
This case should probably be clarified in XPath 2.0's functions
( http://www.w3.org/TR/xquery-operators/#func-normalize-space )

> In this case it would be nice to be able to test for some whitespace as
> opposed to an empty string.

test="string() and not(normalize-space())"

would tell you if the string's not empty and that it is empty
when its whitespace is normalized.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.