xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sheldon Glickler <sheldo...@thevillages.net>
Subject Re: Question on page wrap
Date Sat, 01 Nov 2008 12:08:58 GMT
Andreas Delmelle wrote:
> On Oct 31, 2008, at 20:03, Sheldon Glickler wrote:
> 
>> I have a report that has an arbitrary number of columns.  The number 
>> of columns is such that it would go beyond the page width.  Also the 
>> number of rows is such that it goes beyond the page height.
> 
> Problematic. XSL-FO 1.1 knows no 'vertical' page-breaks. The table will 
> only be broken in block-progression-direction (if there is no 
> keep-property telling us otherwise), and clipped if it doesn't fit the 
> page in inline-progression-direction.
> 
> None of your proposed fallbacks are possible in XSL-FO, IIRC. Not only 
> in FOP, but any implementation...
> 
> 
> Cheers
> 
> Andreas

Wow!  That is **some** major drawback.

First, I am using .20-5 (and cannot upgradee).  I had envisioned doing 
something with coding.  I know how wide my columns are and how many rows 
will fit on a page.

I imagine I could use two loops, one for horizontal and one for 
vertical.  That would mean, for the horizontal, writing the header block 
as Header1_1, Header1_2, etc.  I would then have in the XSL templates 
for Header1_1, FirstColumns1_1, Body1_1, Header1_2, FirstColumns1_2, 
Body1_2, etc. where FirstColumns1_2 was a repeat of FirstColumns1_1.

If there were a "page break" instruction, I could then limit the Body1, 
Body2 to those lines that fit, and then repeat with Header2_1, 
FirstColumns2_1, Body2_1, Header2_2, FirstColumns2_2, Body2_2, etc. 
where Header2_1 was a repeat of Header1_1 and FirstColumns2_2 was a 
repeat of FirstColumns2_1and so on.

All of that would simply mean enclosing those sections in similarly 
named (as above), but different xml blocks and having all those 
templates called by the xsl.  For simplicity, I would have to add one 
more level to the structure so that, for example, all the Headerx_y 
templates would just invoke the Header template which is written for an 
arbitrary number of columns.  Likewise for the body stuff.

I can code all of this to make it semi-general, and it should work.  It 
is predicated, however, on being able to force a page break.  It alos 
seems rather cumbersome, as there should be some sort of "wrap" 
instruction.

Since what I said above might be a little confusing, I have drawn a 
picture below for one expansion horizontally and one vertically 
illustrating my thinking.  Again, this is predicated upon having a page 
break command.

PDF
===
--------- Header1_1 -----          --------- Header1_2 -----
FirstColumns1_1   Body1_1          FirstColumns1_2   Body1_2

--------- Header2_1 -----          --------- Header2_2 -----
FirstColumns2_1   Body2_1          FirstColumns2_2   Body2_2

XSL
===
<xsl:apply-templates select="Header1_1" />
<xsl:apply-templates select="FirstColumns1_1" />
<xsl:apply-templates select="Body1_1" />
<xsl:apply-templates select="Header1_2" />
<xsl:apply-templates select="FirstColumns1_2" />
<xsl:apply-templates select="Body1_2" />
<xsl:apply-templates select="Header2_1" />
<xsl:apply-templates select="FirstColumns2_1" />
<xsl:apply-templates select="Body2_1" />
<xsl:apply-templates select="Header2_2" />
<xsl:apply-templates select="FirstColumns2_2" />
<xsl:apply-templates select="Body2_2" />

<xsl:template match="Header1_1">
     <xsl:apply-templates select="Header" />
<xsl:template match="Header1_2">
     <xsl:apply-templates select="Header" />
<xsl:template match="Header2_1">
     <xsl:apply-templates select="Header" />
<xsl:template match="Header2_2">
     <xsl:apply-templates select="Header" />

and so on.

XML
===
<Header1_1><Header> stuff1 </Header></Header1_1>
<Header1_2><Header> stuff2 </Header></Header1_2>
<Header2_1><Header> stuff1 </Header></Header2_1>
<Header2_2><Header> stuff2 </Header></Header2_2>

and so on








---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message