[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: HTML Tidy on 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(., '
', ' ')" /> </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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|