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

XML->XSL-> FO->PDF whitespace problems

Subject: XML->XSL-> FO->PDF whitespace problems
From: Michael Engelhart <mengelhart@xxxxxxxxxxxxx>
Date: Fri, 8 Mar 2002 15:20:22 -0500
whitespace pdf
Hi,

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:

	NAME
	ADDRESS
	CITY, STATE, ZIP
		BEGIN PARAGRAPH

		BEGIN SECOND PARAGRAPH
			BEGIN SUBPARAGRAPH

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"
                font-family="Courier"
                line-height="12pt"
                text-align="left"
                white-space-collapse="false">
			<xsl:text>       </xsl:text><xsl:value-of select="." />
	</fo:block>
</xsl:template>


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: 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.