W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 2000

XSL FO: suppress-at-line-break and white-space treatment

From: MURAKAMI Shinyu <murakami@nadita.com>
Date: Sat, 27 May 2000 14:48:44 +0900
To: xsl-editors@w3.org
Message-Id: <200005271448.IBJ87302.JBBVNLNS@nadita.com>
Dear xsl-editors

Question:
How to put a program-code-like-text in XSL FOs?

A simple example:
---------------------------------------
<fo:block linefeed-treatment="preserve"
          white-space-collapse="false" 
          wrap-option="no-wrap"
          font-family="monospace">
/* hello.c */
main()
{
    printf("Hello, world\n");
}
</fo:block>
---------------------------------------

In the printf line, I put space chars (u+0020) for indentation.

The formatter will output:
-------------------------
/* hello.c */
main()
{
printf("Hello, world\n");
}
-------------------------

The white-space indentation is suppressed.
I specified white-space-collapse="false", but in this case
not effective, because of the XSL WD 2000-03-27 spec 
[7.14.3 "suppress-at-line-break"].
Space chars at begining and end of line are suppressed by 
suppress-at-line-break="auto" (initial value).

I want to put suppress-at-line-break="retain" on the fo:block,
but can not, because this property applies to only fo:character 
and not inheritable.

IMHO, a inheritable suppress-at-line-break="retain" is expected,
or the behavior of suppress-at-line-break="auto" controlled
by white-space-collapse="false".


Another question:
Is the linefeed char of very begining or end of text node suppressed?

In HTML,
<PRE>
Hello
</PRE>

is equivalent to

<PRE>Hello</PRE>

but in XML not.
If linefeed-treatment="preserve" is specified, then all linefeeds
are preserved. (?)
Example:

<fo:block linefeed-treatment="preserve">
Hello
</fo:block>

The formatter will output blank lines before and after "Hello".

Is it correct?  
Or linefeeds are trimmed when the FO tree is constructed (by objectify)?


Last question:
How to format the tab (u+0009) when white-space-collapse="false" and
space-treatment="preserve"?  Expand to n spaces?


Thanks,
MURAKAMI Shinyu
Received on Saturday, 27 May 2000 01:47:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:50 GMT