Subject: Re: Fwd: Over/under trimming of whitespace
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 25 Apr 2002 17:34:58 -0400
|
[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
|