Re: XSL PR - white-space-collapse


The XSL FO group discussed this issue in depth.  We note that the
results you desire match what is commonly done in HTML browsers.

Though we can see the potential usefulness of being able to get
what you want, we decided that it would be too dangerous to try
to make any such changes at this stage in the spec.  We have spent
lots of time during development of the spec on whitespaces, spacing 
issues, and the area model, and we fear that any such change may have 
unexpected results.  In general, if the user's document puts white space, 
for example, at the beginning of a paragraph, and the XSL-fo stylesheet
doesn't remove them, then that whitespace will get reflected in the output.  
(And it is up to the XSL-fo stylesheet to be sure not to introduce new 
unwanted whitespace into the FO result tree.)

I note we are changing the initial value for white-space-treatment to
ignore-if-surrounding-linefeed, but I also note that that change
in your example below doesn't change your results.

So after much debate, we decided not to add a new property value in this 
area for XSL 1.0. 


At 16:28 2001 09 22 -0400, MURAKAMI Shinyu wrote:
>7.15.12 "white-space-collapse"
>    true 
>        Specifies, for any character flow object such that:
>            - its character is classified as white space in XML, and 
>            - it is not, however, a U+000A (linefeed) character, and 
>            - the immediately preceding flow object is a character flow
>              object with a character classified as white space in XML 
>              or the immediately following flow object is a linefeed, 
>        that flow object shall not generate an area.
>I think this definition is not sufficient.
>whitespaces should be discarded also at beginning of line-area and end 
>of line-area.
><fo:block white-space-treatment="preserve"
>          linefeed-treatment="treat-as-space"
>          white-space-collapse="true">
>  AAA   AAA
>  <fo:block>
>    BBB
>  </fo:block>
>  CCC
>These FOs generate three line-areas. 
>Before white-space-collapse is processed, these texts are:
>    ___AAA___AAA___
>    _____BBB___
>    ___CCC_
>    (here, space is represented as _ )
>In each line-area spaces should be normalized.
>Usually, we expect the following results:
>    AAA_AAA
>    BBB
>    CCC
>    (spaces are discarded at beginning and end of line-area)
>and not expect:
>    _AAA_AAA_
>    _BBB_
>    _CCC_

Received on Thursday, 4 October 2001 10:19:05 UTC