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

Re: Fwd: Over/under trimming of whitespace

Subject: Re: Fwd: Over/under trimming of whitespace
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 25 Apr 2002 17:34:58 -0400
trimming out spaces in javascript
[David Morris]
>
> I have a stylesheet to convert from XHTML to FOP. I haven't been
> able to come up with a good way to distinguish between an element
> like <td></td>, <td/>, and <td>-some whitespace-</td>.
>
> I want an element with whitespace to do nothing and to generate an:
> <fo:inline white-space-collapse="false"> </fo:inline>
>
>...
> The bigger problem is that specifying the following
> on a template rule that matches an element with whitespace
>
> <fo:inline white-space-collapse="false"> </fo:inline>
>
> becomes
>
> <fo:inline white-space-collapse="false"/>
>
> rendering this solution completely useless.
>

You could put in a non-breaking space:

<fo:inline white-space-collapse="false">&#160;</fo:inline>

Otherwise, you have to instruct the parser to leave whitespace-only nodes
alone (depends on the parser defaults).  How to do that depends on the
parser.  If the parser takes them out, xsl:preserve-space can't do anything
about because it's too late by then.

Cheers,

Tom P


 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.