AH Formatter / XSL Formatter
Q&A



XSLT/XSL-FO/MathML Technics

Space

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 set white-space-collapse="false" with fo:block such as: <fo:block white-space-collapse="false">&#x0020;</fo:block>. But XSL Formatter does not insert blank line, and deletes white spaces (U+0020) at the start of paragraph. How can I generate a blank line or retain white spaces at the start of a paragraph? [No.2003101601]
A. 

The treatment of white space at a line break point is different in V2/V3.0/V3.1R1 and V3.1MR1.

In XSL Formatter V2/V3.0/V3, the treatment of white space at a line-break point is specified by suppress-at-line-break property.

7.16.3 "suppress-at-line-break"

Initial value of suppress-at-line-break is auto, and code point U+0020 is treated as if 'suppress' had been specified. As a result, the generated area is deleted.

To retain white space at line-break point, please specify usage-context-of-suppress-at-line-break="ignore" such as:

<fo:block white-space-collapse="false" usage-context-of-suppress-at-line-break="ignore">
     &#x0020;
</fo:block>.

usage-context-of-suppress-at-line-break (UCSLB) property was introduced in Errata in REC-xsl-20011015.

In current XSL 1.0 Errata, the specification of suppress-at-linebreak and white-space-treatment are changed, and usage-context-of-suppress-at-line-break is deleted. Before it was changed, the following specifications had been defined.

7.16.4 "usage-context-of-suppress-at-line-break"

XSL Definition:

Value: auto | observe | ignore | inherit
Initial: auto
Applies to: fo:block, fo:inline, fo:page-number, fo:page-number-citation
Inherited: yes
Percentages: N/A
Media: visual

This property specifies the usage context of the character property "suppress-at-line-break". It specifies if this character property should apply or not.

Values for this property have the following meanings:

auto
If the value of the "wrap-option" trait on the current formatting object to which the "usage-context-of-suppress-at-line-break" applies is "no-wrap", the "auto" value specifies the same processing of descendant fo:character formatting objects as if "ignore" had been specified for the "usage-context-of-suppress-at-line-break" property. Otherwise it specifies the same processing of descendant fo:character formatting objects as if "observe" had been specified for the "usage-context-of-suppress-at-line-break" property.

observe
Specifies that descendant fo:character formatting objects should be treated using the computed value of the "suppress-at-line-break" property of the fo:character formatting object.

ignore
Specifies that descendant fo:character formatting objects should be treated as if the "suppress-at-line-break" property of the fo:character formatting object had the value "retain".

It may control the suppress-at-line-break (SLB) property as follows:

wrap-option
wrap (initial) no-wrap
SLB SLB
auto suppress retain auto suppress retain
U
C
S
L
B
auto D D R R R R
observe D D R D D R
ignore R R R R R R
R: white space is retained.
D: white space is deleted.

In XSL Formatter, suppress-at-line-break is not supported. Therefore, it is processed as an initial value "auto". However, this property cannot be specified for fo:block even if supported.

The reason is that this property is applied to fo:character, and it is not inherited. Therefore, it is necessary to specify property by using fo:character as follows.

<fo:block>
    <fo:character character="' '" suppress-at-line-break="retain"/>
</fo:block>

XSL Formatter supports usage-context-of-suppress-at-line-break. Therefore, when usage-context-of-suppress-at-line-break="ignore" is specified, the space is not deleted in suppress-at-line-break="auto".

XSL Formatter V3.1MR1 changed the processing of white-space-treatment and suppress-at-line-break according to latest XSL 1.0 Errata and XSL 1.1 WD. If white-space-treatment="preserve" is specified, the white space of line-break point is retained. And usage-context-of-suppress-at-line-break is maintained for compatibility. If the value is auto, it works as observe. ( If value is auto and wrap-option="no-wrap", it works as ignore before these are changed. ) If usage-context-of-suppress-at-line-break="ignore" is specified, the white space is retained as well as before.


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