- From: Paul Grosso <pgrosso@arbortext.com>
- Date: Mon, 02 Jul 2001 18:08:37 -0500
- To: MURAKAMI Shinyu <murakami@nadita.com>, xsl-editors@w3.org
- Cc: w3c-xsl-fo-sg@w3.org
By way of followup to my earlier response: At 09:28 2001 07 02 -0500, Paul Grosso wrote: >MURAKAMI Shinyu wrote: >>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". > >There is another property called space-treatment in the CR: >http://www.w3.org/TR/xsl/slice7.html#space-treatment >but renamed to white-space-treatment in the latest draft for consistency. >It should be set to "preserve" to accomplish what you want. The above is correct. >It appears that the "suppress-at-line-break" description (especially >that of its "auto" value) needs to make reference to the >white-space-treatment property. Specifically, it should say that the >meaning of suppress-at-line-break="auto" for the character at codepoint >U+0020 is determined by the value of the white-space-treatment property. >I will discuss this clarification with the XSL FO Subgroup. I was not completely accurate above. As Anders pointed out, suppress-at-line-break is only for *formatter-generated line breaks* whereas white-space-treatment (as far as it relates to adjacent linefeeds) is only about white space adjacent to linebreaks *in the FO tree*. Hence, there is no contradiction and no need for a spec change. >>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)? > >As you note, in XML, those linefeeds are not trimmed when the XSL stylesheet >is read (regardless of the existence of linefeed-treatment, about which of >course the XML parser knows nothing) unless xsl:strip-space is in force. > >Then when the formatter processes this document with linefeed-treatment >set to preserve, the linefeeds will be processed (and cause extra line >areas to be generated). There is nothing special about linefeeds at >the beginning or end of text nodes. > >This is my understanding, but I will confirm this with the rest of >the XSL FO subgroup. Anders confirms my understanding. >>Last question: >>How to format the tab (u+0009) when white-space-collapse="false" and >>space-treatment="preserve"? Expand to n spaces? > >It appears that we have not covered this case in the spec. >I will have to discuss this with the rest of the subgroup. >However, I do remember making the explicit decision not to >have a tab-character-treatment property but just to lump >tab treatment in with other white space character treatment, >so my suggestion would be to treat each u+0009 character as >a (single) u+0020 space. Anders basically agrees and suggests that the "preserve" value of "white-space-treatment" should read: Specifies that any character flow object whose character is classified, before any linefeed-treatment handling is considered, as white space in XML, except for U+000A (linefeed) characters, shall be converted during the refinement process into a character flow object whose Unicode code point is U+0020 (space). paul
Received on Monday, 2 July 2001 19:09:12 UTC