[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: fo:table problem (using Apache FOP)

Subject: Re: fo:table problem (using Apache FOP)
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Wed, 06 Feb 2002 12:34:07 +0100
fop page header table
"Sami, Abdul (Netprosys)" <asami@xxxxxxxxxx> wrote:
> I am using Xsl to genrate Pdf report(Apache FOP). The problem i am facing is
> that it leaves a  big margin at the bottom of each page.
> I want it should leave space just as the Footer defined. But it leaves a lot
> of space and change the page.

I was not able to reproduce the problem. I may have misunderstood
your question, or the problem depends on the XML input which you didn't
supply. In general, if you have questions pertaining FO, it's prudent
to post the FO file (trimmed down as much as possible), or post both
the XSLT and a sample XML which exhibits the problem. It also often
helps to note the version number of the software you are using.

However, there are some general remarks:
> <fo:simple-page-master ... master-name="first">
> 	<fo:region-before extent="6cm"/>
> 	<fo:region-body margin-top="2.5cm"/>
> 	<fo:region-after extent="1.5cm"/>
> </fo:simple-page-master>

Your regions overlap. In most cases, this is not the intention.
In order to avoid surprises, it is advisable that the margin-top
of the region-body matches the extend of region-before, and
margin-bottom of region-body matches the extend of region-after.

> <xsl:template match="header/lines">
>  <xsl:for-each select="line">
>    <xsl:if test="position()=1">
>      <fo:table-row space-after.optimum="1pt">
>        <fo:table-cell number-columns-spanned="2">
>          <fo:block ...>
>            <xsl:value-of select="left"

Having a xsl:for-each and a set of exclusive xsl:if is odd.
You could simply write
  <xsl:template match="header/lines">
    <fo:table-row space-after.optimum="1pt">
       <fo:table-cell number-columns-spanned="2">
          <fo:block ...>
             <xsl:value-of select="lines[1]/left"
                                        ^^^
and so on.

> <xsl:template match="row">
> ...
>   <xsl:for-each select="cell">
>    <fo:table-cell>
>      <xsl:if test="position()=1">
>        <xsl:call-template name="left-data-block" />

Same here, even though using the context within the called
template seems to complicate it. You can pass the element to be
formatted as a parameter, or since the called templates actually
don't do something significant, you can always inline them (like
it is done for formatting the page header lines).

> <xsl:template name="left-indented-data-block">
>   <fo:block text-align="start">
>     <xsl:call-template name="space-4" />
> 	 <xsl:value-of select="content" />
>   </fo:block>
> </xsl:template>
> 
> <xsl:template name="space-1">
> <fo:inline white-space-collapse="false"><fo:character character='
> '/></fo:inline>
> </xsl:template>

Using spaces for indentation has some pitfalls and is therefore
discouraged (and may get you tarred and feathered if you had claimed
professionality in typesetting before).
You should use text-indent, for example:
  <fo:block text-indent="1en"> ...

HTH
J.Pietschmann

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.