[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Re: 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)
html preserve white space
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.