[Logo] Forums for GrailsFlow, Weceem, XSLfast
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Mixed 2-column and 1-column layout  XML
Forum Index » XSLfast Forum
Author Message
Roland Vonk



Joined: 02/03/2010 10:38:07
Messages: 6
Offline

Hi there,

Thanks a lot for the response on my previous question, it fixed the thing! Now i've got a new question.

I need to make a layout which consists of both pages with no column and pages with 2 columns. The first one is needed for short chapters (mostly 1-page) with not a lot of content, the second we will use for larger chapters with lots of content. Which layout should be used will be determined in the XML (an attribute on a chapter node specifying which layout should be used for that chapter).

I have no clue on how to do such a thing with xslfast. I suspect the answer (if there is one) will be to use the multi-layout manager in some way. If so, I would like to know how?

And if i have to use the multi-layout manager, is it also possible to generate the full xsl of the multi-template?

Thanks again,

Roland Vonk
Victor Krapivin



Joined: 04/06/2009 10:12:44
Messages: 45
Offline

The possible way is to make two groupings - one with short chapters and second with long ones.

In this case, you can simply add yet another page sequence (Page->Insert->Add main page)

For every page (named main in tab) you need to

- specify proper grouping you need (for short stories or for long stories)
- specify amount of columns (2 or 1 respectively).

For this case, you'll have pages with short articles first and in 2-column layout, and the pages with one column and long articles at the rest.

If you've using XSLfast prior to 3.1, you can do the same via MultiLayout manager, as follows:

1. Define main page, with XML you need. It will have only multi-layout information, so don't worry about contents.

2. Define layout with first page sequence: attach the same XML as for p1, define virtual grouping as noted above, and assign it to page (or to table if you prefer table-oriented output). Specify two columns per page, and arrange content as you need.

3. In the same manner, define second page in separate layout: the same XML, the same virtual groupings, but one column output.

4. Return to master layout from p1. In MultiLayout manager, add both layouts via drag and drop, and specify to it the same expression (1)

5. Assign to every added page its' own unique group.

6. Now you can generate PDF file. If you need XSL file too, please follow to Page -> Layout settings and take a look where it will be generated, and copy the file to place you need.

Note: for 2nd way, you need always use MultiLayout manager to generate PDF files.

This message was edited 1 time. Last update was at 31/03/2010 17:39:59


Best regards,
Victor Krapivin
[WWW]
Roland Vonk



Joined: 02/03/2010 10:38:07
Messages: 6
Offline

Hi Victor, that's quick, thanks!

However, I am looking for a way to mix the two page types without knowing a) how many chapters will be needed and b) which will need the one-column layout and which the two-column. The XML is constructed dynamically, and the user may make a choice for each chapter. The choice is stored in an attribute of the chapter node. So basically I have an unknown number of chapter nodes, each with an attribute that says which layout to use. And I cannot use multilayout manager for this, the XML is delivered to a service that uses the XSL to generate XSL-FO and then call FOP.

Is there any way I can do such a thing with XSLFast? I've done it before with another tool, but it was a bit complicated. All possible page layouts were available, and for each chapter I went through all of them and the one that matched the chapter attribute that specified the layout was used for that chapter. Is any such thing possible in your tool also?

Thanks!

Victor Krapivin



Joined: 04/06/2009 10:12:44
Messages: 45
Offline

I'm sorry but output for 1 column and output for 2 columns are attributes of page sequences, so you can't simply make mixed output for pages with difernt columns. But you can all time make output for 2-column pages first, by specifying proper groupings.

For example, you have the following XML:



So, you can define two virtual groupings for this case:



and



Now, we ready to make two page sequences: Page1 and Page2.

At Page1 we defining two-columns output, for page 2 - one column output.

Now, we ready to fill every page with contents, for example as follows:

1. Define a table (1 column, 1 row).
2. Assign proper grouping to table (right click->add table grouping), like article[@type='two-columns']
3. Place contents in table cell (for your case it will be '.')
4. Repeat steps 1-3 for 2nd page, but use other grouping to it.

As result, you have XSL that makes report in XSL-FO for your XML structure, without dependency how much articles inside, and shows at first couple of pages articles in two columns, and the rest couple of pages contains articles dedicated for one-column output.

Of course this way is available for XSLfast 3.1 or later.

Best regards,
Victor Krapivin
[WWW]
Roland Vonk



Joined: 02/03/2010 10:38:07
Messages: 6
Offline

Hi Victor,

Thanks. My understanding is: what I want to accomplish is currently not possible with xslfast unfortunately, and there are no work-arounds (your suggestion will not work, since I cannot change the logical sequence of items).
Maybe "attributes on page sequences" can be added to your development plan?
Victor Krapivin



Joined: 04/06/2009 10:12:44
Messages: 45
Offline

Sorry, if you want to place 1-column output and 2-column output at one page, this option is not possible due to XSL-FO restrictions. You can either place every article on separate page sequence, or reorder your data to place on two page sequences.

I've added your proposition n our road-map to XSLfast 4.1: http://jira.jcatalog.com/browse/XSL-1568

This message was edited 1 time. Last update was at 01/04/2010 15:16:42


Best regards,
Victor Krapivin
[WWW]
 
Forum Index » XSLfast Forum
Go to:   
Powered by JForum 2.1.8 © JForum Team