Re: [xsl] How to preserve white space of a title line

Subject: Re: [xsl] How to preserve white space of a title line
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Mon, 09 Apr 2001 10:07:25 GMT
>Need help to use preseve-space element as following case;
>1  use param to define a title line, such as
><xsl:param name="titleLine" select="Annual    report    for    xxxx"/>
>There are  two or more white spaces between each word.
>2  Try to use <xsl:preserve-space>  commads but can not figure out how to
>use it,
>   since the attritute of presrve is for element.

It is hard to say what your problem is, but it will not be solved with
xsl:preserve-space.  This specifies what to do with white-space-only
nodes in the *source* document, such as in the following non-empty
  <text>      </text>

Even then, it only has an effect if you are also using a
<xsl:strip-space> which matches the same element.

We need to know how you are using this parameter, and what output mode
you are using (html, xml, text?).  I can only think of two ways these
spaces could get lost:
  1) you are using the function normalize-space() on this value
  2) you are generating HTML, and are forgetting that browsers
generally display multiple spaces the same as a single space

Other guesses anyone?

Trevor Nash

 XSL-List info and archive:

Current Thread