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

Text divided into several columns?

Expand Messages
  • dennis_joel_david
    Hi. Is there a way to divide a text section into 2 or more columns? Here is an example of the behavior i am looking for: 0 4 8 1 5 9 2 6 3 7 I would like to be
    Message 1 of 4 , Sep 30, 2002
      Hi.
      Is there a way to divide a text section into 2 or more columns?
      Here is an example of the behavior i am looking for:

      0 4 8
      1 5 9
      2 6
      3 7

      I would like to be able to specify the height of the columns, as
      well as the width of each column.
      When there is no more room for text in a column, it should start on
      an new column, on a specified interval to the right from the last
      column.
      Further, I want to place this "box" on an absolute position.
      Is this possible at all?
      If anyone knows the answer for this question, i would really like to
      know.

      Thank You,
      Dennis
    • Douglas Lovell
      Use the column-count property on the region-body FO to specify multiple columns that flow content from one to the next. Those columns will all have equal
      Message 2 of 4 , Sep 30, 2002
        Use the column-count property on the region-body FO to specify multiple
        columns that flow content from one to the next. Those columns will all
        have equal width. Use the column-gap property to specify the width of
        space between the columns. The region-body FO flows content within the
        body of a page. You will not be able to make it a separate box with
        position fixed relative to other flowed content.

        Use table layout elements to define a table with specified column widths.
        Place the table within a block-container FO and use the absolute-position
        property on the block-container to fix the position of the table. You may
        be able to use XSLT counting tricks to "flow" the content from one table
        column to the next. That depends on the structure of your input and other
        specific details of your expected result.

        Douglas Lovell




        "dennis_joel_david"
        <dennis.myren@greyinte To: XSL-FO@yahoogroups.com
        ractive.no> cc:
        Subject: [XSL-FO] Text divided into several columns?
        09/30/2002 03:20 AM
        Please respond to
        XSL-FO





        Hi.
        Is there a way to divide a text section into 2 or more columns?
        Here is an example of the behavior i am looking for:

        0 4 8
        1 5 9
        2 6
        3 7

        I would like to be able to specify the height of the columns, as
        well as the width of each column.
        When there is no more room for text in a column, it should start on
        an new column, on a specified interval to the right from the last
        column.
        Further, I want to place this "box" on an absolute position.
        Is this possible at all?
        If anyone knows the answer for this question, i would really like to
        know.

        Thank You,
        Dennis




        To unsubscribe from this group, send an email to:
        XSL-FO-unsubscribe@egroups.com



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      • dennis_joel_david
        Hi. Do you know if it is possible to use XSLT elements inside a FO document that will be processed by FOP 0.20.4 ? I have tried, without success. And if so,
        Message 3 of 4 , Oct 1 7:15 AM
          Hi.
          Do you know if it is possible to use XSLT elements inside a FO
          document that will be processed by FOP 0.20.4 ?
          I have tried, without success.
          And if so, the XSLT tricks you were talking about, can you give me
          an example of that?
          Thank You
          Dennis


          >You may
          > be able to use XSLT counting tricks to "flow" the content from one
          table
          > column to the next. That depends on the structure of your input
          and other
          > specific details of your expected result.
          > Douglas Lovell
        • Douglas Lovell
          You wouldn t use XSLT elements inside of FO. You will use XSLT to generate FO. Your XML data + XSLT stylesheet = FO result document. The following sample
          Message 4 of 4 , Oct 1 11:28 AM
            You wouldn't use XSLT elements inside of FO. You will use XSLT to generate
            FO. Your XML data + XSLT stylesheet = FO result document.

            The following sample source and stylesheet demonstrate column-ordered
            output into a table. This will deprive you of the fun of solving the
            puzzle for yourself.

            Here is some sample input data. Provide this as the XML data input to the
            formatter:
            <?xml version="1.0"?>
            <data>
            <item>Peter</item>
            <item>Piper</item>
            <item>picked</item>
            <item>a</item>
            <item>peck</item>
            <item>of</item>
            <item>pickled</item>
            <item>peppers.</item>
            <item>How</item>
            <item>many</item>
            <item>peppers</item>
            <item>did</item>
            <item>Peter</item>
            <item>Piper</item>
            <item>pick?</item>
            </data>

            The following stylesheet formats the above data into three columns, in
            column order. Provide it as the XSLT stylesheet input to a table-capable
            formatter:
            <?xml version='1.0'?>
            <xsl:stylesheet version="1.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:fo="http://www.w3.org/1999/XSL/Format">

            <xsl:strip-space elements="*"/>

            <xsl:template match="/">
            <fo:root>
            <fo:layout-master-set>
            <fo:simple-page-master
            master-name="page">
            <fo:region-body
            region-name="body"
            margin-top="0.5in"
            margin-bottom="1in"
            margin-left="0.5in"
            margin-right="0.5in"/>
            </fo:simple-page-master>
            </fo:layout-master-set>
            <fo:page-sequence master-reference="page">
            <fo:flow flow-name="body">
            <xsl:apply-templates/>
            </fo:flow>
            </fo:page-sequence>
            </fo:root>
            </xsl:template>

            <xsl:template match="data">
            <xsl:variable name="ctRows">
            <xsl:value-of select="ceiling(count(*) div 3)"/>
            </xsl:variable>
            <fo:table>
            <fo:table-column column-width="4pc"/>
            <fo:table-column column-width="6pc"/>
            <fo:table-column column-width="12pc"/>
            <fo:table-body>
            <xsl:apply-templates>
            <xsl:sort
            select="floor((position()-1) div $ctRows) + ((position()-1) mod $ctRows) * 3"
            data-type="number"/>
            </xsl:apply-templates>
            </fo:table-body>
            </fo:table>
            </xsl:template>

            <xsl:template match="item">
            <fo:table-cell>
            <xsl:if test="(position()-1) mod 3 = 2">
            <xsl:attribute name="ends-row">yes</xsl:attribute>
            </xsl:if>
            <fo:block>
            <xsl:apply-templates/>
            </fo:block>
            </fo:table-cell>
            </xsl:template>

            </xsl:stylesheet>

            Douglas Lovell




            "dennis_joel_david"
            <dennis.myren@greyinte To: XSL-FO@yahoogroups.com
            ractive.no> cc:
            Subject: [XSL-FO] Re: Text divided
            10/01/2002 10:15 AM into several columns?
            Please respond to
            XSL-FO





            Hi.
            Do you know if it is possible to use XSLT elements inside a FO
            document that will be processed by FOP 0.20.4 ?
            I have tried, without success.
            And if so, the XSLT tricks you were talking about, can you give me
            an example of that?
            Thank You
            Dennis


            >You may
            > be able to use XSLT counting tricks to "flow" the content from one
            table
            > column to the next. That depends on the structure of your input
            and other
            > specific details of your expected result.
            > Douglas Lovell
          Your message has been successfully submitted and would be delivered to recipients shortly.