AH Formatter / XSL Formatter
Q&A



XSLT/XSL-FO/MathML Technics

Block

Top
Basic, General
About AH Formatter
About XSL Formatter
Operation
Programming
XSLT/XSL-FO/SVG/MathML Conformance
XSLT/XSL-FO/MathML Technics
Index
Q.  I am trying to set up the formatting for an element that is the equivalent of the HTML <pre> element, in which all text should be presented exactly as entered. However, it doesn't get me what I expected. Why? [No.2002071902]
A. 

In your stylesheet,

<fo:block white-space-treatment="preserve"
linefeed-treatment="preserve">
  apple
      4, 7, 7, 12
</fo:block>

Initial value of the white-space-collapse property replaces all remaining runs of two or more consecutive spaces by a single space, then any remaining space immediately adjacent to a remaining linefeed is also discarded. Initial value is true. So you have to specify "false"to avoid this.

You need one more property as follows:

<fo:block white-space-treatment="preserve"
linefeed-treatment="preserve" white-space-collapse="false">
  apple
      4, 7, 7, 12
</fo:block>

Copyright © 1999-2011 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.