[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Fwd: Over/under trimming of whitespace


Subject: Re: [xsl] Fwd: Over/under trimming of whitespace
From: "David Morris" <David.Morris@xxxxxxxxxxxxx>
Date: Fri, 26 Apr 2002 23:14:50 -0600

David,

Thank you for helping. 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 - it definitely

did this with Saxon, and I suspect that it does with Xalan but with
Xalan 
I did not look at the intermediate result of my XHTML to FO
translation. 
In this case it would be nice to be able to test for some whitespace as

opposed to an empty string.

Thanks,

David Morris 

>>> davidc@xxxxxxxxx 04/25/02 04:24PM >>>

: I have a couple of problems here, I thought that normalize-space() 
: should return a single character if any whitespace exists.
why?:-)
As you spotted it returns empty string but you only need a minor tweak
to your test
test="normalize-space()='' and .!=''"
is true just if the string value of the current node is non zero white
space.

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



Current Thread
Keywords