Page 1 of 1

xsl-fo and linefeed-treatment

Posted: Sat Jun 13, 2009 4:51 am
by willisd1
I have looked through the previous postings and could not quite find the answer to my question so here it is. It seems like a basic xsl-fo operation so I'm sure someone can help.

I am using the Apache FOP processor that was supplied with Oxygen 10.2
In my XML file I have a <Comment> field that contains several paragraphs of information seperated by (U+000A) linefeeds.
My xsl-fo file has the following block statement -

Code: Select all

<fo:block text-align="justify" line-height="1.1" font="12pt Calibri" font-weight="normal" linefeed-treatment="preserve" white-space-collapse="false" wrap-option="wrap" white-space-treatment="preserve" space-after="0.3in">
<xsl:value-of select="//Inspection[position()=1]/Comment"/>
</fo:block>
In the result .pdf the paragraphs have all run together. It is like the linefeed-treatment statement has no effect. What am I missing?

Thanks in advance,
Sean

Re: xsl-fo and linefeed-treatment

Posted: Sat Jun 13, 2009 6:21 am
by willisd1
Amazing how that works. I struggle and struggle to solve my own problems and don't find the solution until I post it.

The problem turned out to be in my schema. I had the <Comment> element type set as xs:normalizedString.

Since I am using the Saxon-SA 9.0.1.6 Transformer it was replacing each newline, tab and carriage return with a single space character. Thus the xsl-fo processor was not being presented with the original spacing and linefeeds...whew!

Re: xsl-fo and linefeed-treatment

Posted: Mon Jun 15, 2009 10:59 am
by Radu
Hi Sean,

Thanks for sharing the problem and solution with us.

Regards,
Radu