This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Fwd: Over/under trimming of whitespace
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 25 Apr 2002 23:24:18 +0100
- Subject: Re: [xsl] Fwd: Over/under trimming of whitespace
- References: <scc81cf0.099@mail.plumcreek.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
: 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.
: The bigger problem is that specifying the following
: on a template rule that matches an element with whitespace
:
: <fo:inline white-space-collapse="false"> </fo:inline>
:
: becomes
:
: <fo:inline white-space-collapse="false"/>
white space nodes are stripped from the stylesheet by default
except in xsl:text so easiest is to use
<fo:inline white-space-collapse="false"><xsl:text> </xsl:text></fo:inline>
: any whitespace with a retained single character of whitespace.
all this so far is only doing white spae nodes in teh source, it won't
do anything with
<x> a b
c d
</x>
is that OK?
If not, you probably want to use
translate(.,' ',' ')
somewhere...
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list