[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Fwd: Over/under trimming of 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|