This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re: How to preserve white space of a title line


> 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>

   or

   <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: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]