This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Fwd: Over/under trimming of whitespace
- From: "David Morris" <David dot Morris at plumcreek dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 26 Apr 2002 23:14:50 -0600
- Subject: Re: [xsl] Fwd: Over/under trimming of whitespace
- Reply-to: xsl-list at lists dot mulberrytech dot com
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@nag.co.uk 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