This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Fwd: Over/under trimming of whitespace
- From: "Thomas B. Passin" <tpassin at mitretek dot org>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 25 Apr 2002 17:34:58 -0400
- Subject: Re: [xsl] Fwd: Over/under trimming of whitespace
- References: <scc81cf0.099@mail.plumcreek.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
[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"> </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