This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: preserve-space and strip-space?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] preserve-space and strip-space?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Mon, 17 Sep 2001 14:34:43 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Maybe I am wrong on what strip-space and preserve-space are
> supposed to do.
> Using the following XML document, I pad each element's values
> with spaces.
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <links>
> <link> testing pre-stripping</link>
> <link>testing post-stripping </link>
> <link> testing any stripping </link>
> </links>
>
Yes, you are quite wrong. xsl:strip-space and xsl:preserve-space only affect
text nodes that consist entirely of white space.
If you want to remove leading and trailing spaces, consider the
normalize-space() function.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list