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

Re: HTML Tidy on FO files

Subject: Re: HTML Tidy on FO files
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 8 Nov 2001 12:56:01 +0000
fo files
Hi Gustaf,

> I wish to remove all unnecessary linebreaks inside <fo:block>
> elements.

What about using the linefeed-treatment property in XSL to remove them
for you (or turn them into whitespaces):

<fo:block linefeed-treatment="treat-as-space">No
linebreaks
<fo:inline font-weight="bold">here</fo:inline>, please.</fo:block>

should render exactly the same as:

<fo:block>No linebreaks <fo:inline font-weight="bold">here</fo:inline>, please.</fo:block>

without you having to put it through HTML Tidy (which seems to be the
thing causing the problem!). But the linefeed-treatment property
defaults to treat-as-space so the fact that you resorted to HTML Tidy
in the first place implies that this wasn't working for you anyway?

So alternatively, in the XSLT that you're using, you could replace the
linefeed characters with a single space with:

<xsl:template match="text()">
  <xsl:value-of select="translate(., '&#xA;', ' ')" />
</xsl:template>

That would (probably) make Saxon and Xalan output:

<fo:block>No linebreaks <fo:inline font-weight="bold">here</fo:inline>, please.</fo:block>

in the first place. (Only probably because it depends a bit on what
your stylesheet looks like now.)

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.