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

Subject: Re: [xsl] Re: How to preserve white space of a title line
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 9 Apr 2001 19:37:15 -0600 (MDT)
> Now I wonder  is there a better (or straightforward) approach to render
> the string in HTML output mode without using translate function
> and meantime keeps multiple spaces display.

No. This has nothing to do with XSLT, really.

You are producing HTML that looks like this:

   <p>Hello    World</p>

It is a feature of HTML that the spaces in between Hello and World
consitute a single word separator, which means it will be rendered
in the browser with a single breaking space most of the time.

The only place you can avoid this is in a <pre> element, or in an
element with the CSS property 'white-space: pre'. Like:
   <pre>Hello    World</pre>


   <p style="white-space: pre">Hello    World</p>

...although the latter is not widely supported, and the former is
traditionally rendered in a fixed-width font.

In general, if you want non-breaking spaces, don't put regular
spaces in your HTML. Put non-breaking spaces in.

   - Mike
mike j. brown, software engineer at  |  xml/xslt: in denver, colorado, USA    |  personal:

 XSL-List info and archive:

Current Thread