This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: Over/under trimming of whitespace


[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]