Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] Forcing Linebreak in a Block

Expand Messages
  • G. Ken Holman
    ... A single acts like a single . To get the effect of multiple elements in a row, the second and subsequent elements would be
    Message 1 of 3 , Jun 15, 2004
    • 0 Attachment
      At 2004-06-15 06:45 +0000, tlange051264 wrote:
      >I want to write 3 words in a table-cell, one word UNDER the other. The
      >table-cell is too wide to make the break automatically, there all
      >words stand in one line.
      >
      >How can I force a linebreak after each word? (like the <BR>-Tag in
      >HTML)?

      A single <block/> acts like a single <br>.

      To get the effect of multiple <br> elements in a row, the second and
      subsequent <br> elements would be translated to <block><leader/><block>.

      I hope this helps.

      ................... Ken

      --
      Public training 3 days XSLT & 2 days XSL-FO: Phoenix,AZ 2004-08-23
      World-wide on-site corporate, govt. & user group XML/XSL training.
      G. Ken Holman mailto:gkholman@...
      Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
      Legal business disclaimers: http://www.CraneSoftwrights.com/legal
    • Victor Vishnyakov
      ... I know at least tree ways to force line-break: 1. use linefeed-treatment= preserve attribute for fo:block 2. put each line into the separate fo:block 3.
      Message 2 of 3 , Jun 15, 2004
      • 0 Attachment
        > I want to write 3 words in a table-cell, one word UNDER the
        > other. The
        > table-cell is too wide to make the break automatically, there all
        > words stand in one line.
        >
        > How can I force a linebreak after each word? (like the <BR>-Tag in
        > HTML)?

        I know at least tree ways to force line-break:
        1. use linefeed-treatment="preserve" attribute for fo:block
        2. put each line into the separate fo:block
        3. use an empty <fo:block/> as <br> is used in HTML

        See sample fo file in the bottom of the message.

        Regards,
        Victor Vishnyakov

        <!-- SAMPLE -->
        <?xml version="1.0" encoding="UTF-8"?>
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <fo:layout-master-set>
        <fo:simple-page-master master-name="main-page-master"
        margin="2cm">
        <fo:region-body region-name="xsl-region-body"/>
        </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="main-page-master">
        <fo:flow flow-name="xsl-region-body" font-family="Helvetica"
        font-size="10pt">
        <fo:block>
        <fo:block color="gray">This sample file
        shows how to force line breaks.</fo:block>
        <fo:block><fo:leader/></fo:block>
        <!-- SAMPLE BODY -->

        <fo:block>

        <fo:block font-weight="bold">original source</fo:block>
        <!--
        TYPICAL BLOCK -->

        <fo:block text-align="justify" text-align-last="left">"It took me a long
        time to learn where he came from. The little prince, who asked me so many
        questions, never seemed to hear the ones I asked him. It was from words
        dropped by chance that, little by little, everything was revealed to
        me."</fo:block>

        <fo:block><fo:leader/></fo:block>


        <fo:block text-align="right" text-align-last="right"
        font-size="6pt"><fo:wrapper font-weight="bold">"The Little
        Prince"</fo:wrapper> by <fo:wrapper font-style="italic">Antoine de
        Saint-Exupery</fo:wrapper></fo:block>
        <!--
        /TYPICAL BLOCK -->
        </fo:block>

        <fo:block>

        <fo:block font-weight="bold">linefeed-treatment="preserve"</fo:block>
        <!--
        TYPICAL BLOCK -->

        <fo:block text-align="justify" text-align-last="left"
        linefeed-treatment="preserve">"It took me a long time to learn where he came
        from.
        The little prince, who asked me so many questions, never seemed to hear the
        ones I asked him.
        It was from words dropped by chance that, little by little, everything was
        revealed to me."</fo:block>

        <fo:block><fo:leader/></fo:block>


        <fo:block text-align="right" text-align-last="right"
        font-size="6pt"><fo:wrapper font-weight="bold">"The Little
        Prince"</fo:wrapper> by <fo:wrapper font-style="italic">Antoine de
        Saint-Exupery</fo:wrapper></fo:block>
        <!--
        /TYPICAL BLOCK -->
        </fo:block>

        <fo:block>
        <!--
        TYPICAL BLOCK -->

        <fo:block font-weight="bold">each line in the separate block</fo:block>

        <fo:block text-align="justify" text-align-last="left">

        <fo:block>"It took me a long time to learn where he came from.</fo:block>

        <fo:block>The little prince, who asked me so many questions, never seemed to
        hear the ones I asked him.</fo:block>

        <fo:block>It was from words dropped by chance that, little by little,
        everything was revealed to me."</fo:block>

        </fo:block>

        <fo:block><fo:leader/></fo:block>


        <fo:block text-align="right" text-align-last="right"
        font-size="6pt"><fo:wrapper font-weight="bold">"The Little
        Prince"</fo:wrapper> by <fo:wrapper font-style="italic">Antoine de
        Saint-Exupery</fo:wrapper></fo:block>
        <!--
        /TYPICAL BLOCK -->
        </fo:block>

        <fo:block>

        <fo:block font-weight="bold">each line is separated by an empty
        fo:block</fo:block>
        <!--
        TYPICAL BLOCK -->

        <fo:block text-align="justify" text-align-last="left">"It took me a long
        time to learn where he came from.<fo:block/>The little prince, who asked me
        so many questions, never seemed to hear the ones I asked him.<fo:block/>It
        was from words dropped by chance that, little by little, everything was
        revealed to me."</fo:block>

        <fo:block><fo:leader/></fo:block>


        <fo:block text-align="right" text-align-last="right"
        font-size="6pt"><fo:wrapper font-weight="bold">"The Little
        Prince"</fo:wrapper> by <fo:wrapper font-style="italic">Antoine de
        Saint-Exupery</fo:wrapper></fo:block>
        <!--
        /TYPICAL BLOCK -->
        </fo:block>

        <!-- /SAMPLE BODY -->
        <fo:block><fo:leader/></fo:block>
        <fo:block color="gray"
        text-align-last="right">created by Victor Vishnyakov (<fo:basic-link
        external-destination="url(mailto:tch@...)"
        text-decoration="underline">tch@...</fo:basic-link>) for
        <fo:basic-link external-destination="url(http://www.xslfo-zone.com/)"
        text-decoration="underline">http://www.xslfo-zone.com/</fo:basic-link></fo:b
        lock>
        </fo:block>
        </fo:flow>
        </fo:page-sequence>
        </fo:root>

        > -----Original Message-----
        > From: tlange051264 [mailto:tlange@...]
        > Sent: Tuesday, June 15, 2004 9:45 AM
        > To: XSL-FO@yahoogroups.com
        > Subject: [XSL-FO] Forcing Linebreak in a Block
      Your message has been successfully submitted and would be delivered to recipients shortly.