Hahn Kurt (CHA) wrote:
I'm generating a document from a DB which contains fields of up to 2000
characters In those fields,any line-break is stored, and if I look at my
XSL-FO in a text-editor, I see that all the line-breaks are still there.
They're of the form: 
. If process the document through FOP (the
contents are displayed in table cells), Acrobat seems to ignore the
line-breaks completely. Does FOP strip away the 
? Or do I have to use another line-break
character?

If the data is reparsed, the XML parser is oblieged to normalize a CR (U+000D) to LF (U+000A) (if you write 
 instead of putting a CR into the text you get a CR delivered to FOP). If you are passing the data in-memory, FOP will see the CR. After this, linefeeds are possibly converted to spaces, according to the value of linefeed-treatment in effect http://www.w3.org/TR/xsl/slice7.html#linefeed-treatment and then white space is collapsed, controlled by the values of white-space-treatment and white-space-collapse

If you want to have your line breaks preserved, you
should set linefeed-treatment to preserve. Unfortunately,
FOP doesn't implement this. You can set white-space-collapse
to false, which will not only keep runs of spaces but also
the linefeeds intact (which is actually a bug).
If you want to have white space collapsed, you can
- do this at a transformation level
- use a transformation which transforms each run of characters
  between two line bbreaks into a separate fo:block
- translate the CR to 
 (Unicode LINE SEPARATOR) which
  is apparently treated specially

HTH
J.Pietschmann



Reply via email to