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

Re: How to preserve white space of a title line

Subject: Re: How to preserve white space of a title line
From: Mike Brown <mike@xxxxxxxx>
Date: Mon, 9 Apr 2001 13:53:56 -0600 (MDT)
preserve whitespace java xml
>1  use param to define a title line, such as
><xsl:param name="titleLine" select="Annual    report    for    xxxx"/>

You forgot the single quotes to indicate that it is a string rather than 
a node-set.

  <xsl:param name="titleLine" select="'Annual    report    for    xxxx'"/>

I see no reason why this wouldn't work. The default value of $titleLine
will be the string with all the spaces intact.

As Trevor indicated, perhaps you are emitting this string in an HTML
document and are confused by the fact that runs of whitespace in HTML
constitute a single word separator and are thus rendered with a single
space in Western writing scripts. You didn't say what the problem really 
was.

<xsl:value-of select="translate($titleLine,' ','&#160;')"/> may be of 
some utility for you.

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