Altova Mailing List Archives

RE: [xsl] XML->XSL-> FO->PDF whitespace problems

From: "Joseph.Braun" <Joseph.Braun@---------->
Date: 3/8/2002 10:53:00 AM
I had to play around with this too.  
Try the wrap-option="no-wrap" and white-space-collapse="false"

<fo:block font-size="10pt" font-family="Courier" line-height="15pt"
space-after.optimum="3pt" text-align="left" wrap-option="no-wrap"
white-space-collapse="false"  >

-----Original Message-----
From: Michael Engelhart [mailto:mengelhart@xxxxxxxxxxxxx]
Sent: Friday, March 08, 2002 2:20 PM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] XML->XSL-> FO->PDF whitespace problems


I've spent the last few hours searching the archives of this list and a 
few others and can't find what I'm looking for.

I am using FOP 0.20.3, Xalan 2.2 to do XML->PDF transforms.  I have an 
element that is preformatted legacy text.  It's got tabs and spaces and 
linefeed/carriage returns.    I want to output this in the PDF in the 
same format.

Here's a sample:



Now the reason I'm posting to this list is that I can take a xsl:fo file 
and transform the text if I copy and paste it into the FO document and 
then run FOP on it.  The PDF that is generated is formatted perfectly.   
But when I do the transform to FO dynamically with XSL, it removes all 
the carriage returns/line feeds.

Here's the XSL that I'm using for the element:

<xsl:template match="LegacyTextData">
       <fo:block font-size="9pt"
			<xsl:text>       </xsl:text><xsl:value-of select="."

I can't use linefeed-treatment property since FOP doesn't support it. 
but the real  issue I'm having trouble with is that it appears that 
Xalan is stripping out the linefeeds which I thought the XSLT processor 
isn't supposed to do.

I have also tried using xml:space="preserve" in the LegacyTextData 
element which did nothing, I also added the disable-output-
escaping="yes" to the <xsl:value-of /> statement.

any tips on what's going on would be appreciated.

 XSL-List info and archive:

 XSL-List info and archive:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.