Re: [xsl] Using multiple columns based on content

Subject: Re: [xsl] Using multiple columns based on content
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 Dec 2011 14:51:04 -0500
At 2011-12-15 14:02 +0000, Struijk, Toon van der wrote:
Is it possible to switch between one or two columns on a specific page, based on the fact if content is available for a specific column.
I'm making a template for brochures, where the first page has a two-column layout, and all other pages just one column (and this one column has the same width as columns 1 and 2 of the first page). The content on the first page starts in the left column and than flows to the next page where there is only one column (so, it doesn't flow in the second column on the first page, they are not 'connected'). The second column on the first page is used for additional information.
However, there are situations where the second column on the first page is not enough to show all additional information. In these situations I want the next page to also have a second column, so I can flow the remainig additional information from the first page into that second column on the next page.


How to accomplish this.

Yours is a very finicky problem that needs a lot of finesse to accomplish.


The two XSL-FO examples below work, but I've only got them to work with Antenna House V5.3 (they do not work with Antenna House V4.3 or any other XSL-FO tool that I have on hand). Unfortunately due to mail list constraints I cannot post the two PDF files I've created from these XSL-FO files. If you don't have the software, I suspect you could download the evaluation version of Antenna House V5.3 and try these files with that.

I've used a side float and intrusion-displace in order to mimic a second column that dynamically stops on the last page of content for the float.

You've used the noun "column" but I cannot see a way of using page columns (with two different flows) or table columns (with two different cells) in order to give you what you want. I don't think the dynamic nature you need of the semantics are available to you using those approaches. There is no way to dynamically change the page geometry or the table geometry when content does or does not flow to the next page.

Using a side float was a last-ditch effort that appears to work just fine (a bit to my surprise) based on my understanding of how side floats are supposed to work. "toon1.fo" has 2 pages, the first with the two apparent "columns" and the second with one. "toon2.fo" has 4 pages, the first three with two apparent "columns" and the last with one.

You might find using a vendor's intermediate format or custom extension may help you, but I've only looked at this from the perspective of standard XSL-FO constructs. Of course, even with that, it depends on how vendors accommodate standard XSL-FO constructs. For example, I knew Antenna House supported page breaks in block containers in version 5, but I don't think any other tool supports this.

I hope this helps.

. . . . . . . . . . Ken

p.s. does anyone know of a public anonymous place where one can post PDF files for sharing?

<?xml version="1.0" encoding="US-ASCII"?><!--toon1.fo-->
<root xmlns="http://www.w3.org/1999/XSL/Format";
      font-family="Times" font-size="20pt">

  <layout-master-set>
    <simple-page-master master-name="frame"
                        page-height="297mm" page-width="210mm"
                        margin-top="15mm" margin-bottom="15mm"
                        margin-left="15mm" margin-right="15mm">
      <region-body region-name="frame-body"/>
    </simple-page-master>
  </layout-master-set>

<page-sequence master-reference="frame">
<flow flow-name="frame-body">
<block intrusion-displace="block">
<float float="end">
<block-container inline-progression-dimension="80mm" background-color="#eeeeee"
block-progression-dimension.minimum="250mm" font-style="italic">
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
</block-container>
</float>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
</block>
</flow>
</page-sequence>
</root>




<?xml version="1.0" encoding="US-ASCII"?><!--toon2.fo-->
<root xmlns="http://www.w3.org/1999/XSL/Format";
      font-family="Times" font-size="20pt">

  <layout-master-set>
    <simple-page-master master-name="frame"
                        page-height="297mm" page-width="210mm"
                        margin-top="15mm" margin-bottom="15mm"
                        margin-left="15mm" margin-right="15mm">
      <region-body region-name="frame-body"/>
    </simple-page-master>
  </layout-master-set>

<page-sequence master-reference="frame">
<flow flow-name="frame-body">
<block-container intrusion-displace="block">
<float float="end">
<block-container inline-progression-dimension="80mm" background-color="#eeeeee"
block-progression-dimension.minimum="250mm" font-style="italic">
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
<block>This is the sidebar information with enough content to wrap the line</block>
</block-container>
</float>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
<block>This is a test of main content with enough content to wrap the line</block>
</block-container>
</flow>
</page-sequence>
</root>



-- Contact us for world-wide XML consulting and instructor-led training Free 5-hour video lecture: XSLT/XPath 1.0 & 2.0 http://ude.my/uoui9h Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread