Seems simple enough. I copied fox:widow-content-limit into the DocBook
calsTable template:


<xsl:template name="calsTable">

  <xsl:variable name="keep.together">
    <xsl:call-template name="pi.dbfo_keep-together"/>
  </xsl:variable>

  <xsl:for-each select="tgroup">

    <fo:table fox:widow-content-limit="3 * 1.2em"
xsl:use-attribute-sets="table.table.properties">
      <xsl:if test="$keep.together != ''">
        <xsl:attribute name="keep-together.within-column">
          <xsl:value-of select="$keep.together"/>
        </xsl:attribute>
      </xsl:if>
      <xsl:call-template name="table.frame"/>
      <xsl:if test="following-sibling::tgroup">
        <xsl:attribute name="border-bottom-width">0pt</xsl:attribute>
        <xsl:attribute name="border-bottom-style">none</xsl:attribute>
        <xsl:attribute name="padding-bottom">0pt</xsl:attribute>
        <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
        <xsl:attribute name="space-after">0pt</xsl:attribute>
        <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
        <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
        <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
      </xsl:if>
      <xsl:if test="preceding-sibling::tgroup">
        <xsl:attribute name="border-top-width">0pt</xsl:attribute>
        <xsl:attribute name="border-top-style">none</xsl:attribute>
        <xsl:attribute name="padding-top">0pt</xsl:attribute>
        <xsl:attribute name="margin-top">0pt</xsl:attribute>
        <xsl:attribute name="space-before">0pt</xsl:attribute>
        <xsl:attribute name="space-before.minimum">0pt</xsl:attribute>
        <xsl:attribute name="space-before.optimum">0pt</xsl:attribute>
        <xsl:attribute name="space-before.maximum">0pt</xsl:attribute>
      </xsl:if>
      <xsl:apply-templates select="."/>
    </fo:table>
  </xsl:for-each>
</xsl:template>

However, when I build now I get the following exception. Anyone know
what I'm doing wrong?

Regards,
Jeff Powanda


SEVERE: Exception
java.lang.ClassCastException: org.apache.fop.layoutmgr.SpaceElement
        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
        at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)

---------

java.lang.ClassCastException: org.apache.fop.layoutmgr.SpaceElement
        at
org.apache.fop.layoutmgr.ElementListUtils.removeLegalBreaksFromEnd(Eleme
ntListUtils.java:152)
        at
org.apache.fop.layoutmgr.list.ListBlockLayoutManager.getNextKnuthElement
s(ListBlockLayoutManager.java:130)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLa
youtManager.java:113)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.list.ListItemLayoutManager.getNextKnuthElements
(ListItemLayoutManager.java:229)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.list.ListBlockLayoutManager.getNextKnuthElement
s(ListBlockLayoutManager.java:119)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLa
youtManager.java:113)
        at
org.apache.fop.layoutmgr.table.TableCellLayoutManager.getNextKnuthElemen
ts(TableCellLayoutManager.java:168)
        at
org.apache.fop.layoutmgr.table.TableContentLayoutManager.createElementsF
orRowGroup(TableContentLayoutManager.java:480)
        at
org.apache.fop.layoutmgr.table.TableContentLayoutManager.getKnuthElement
sForRowIterator(TableContentLayoutManager.java:243)
        at
org.apache.fop.layoutmgr.table.TableContentLayoutManager.getNextKnuthEle
ments(TableContentLayoutManager.java:183)
        at
org.apache.fop.layoutmgr.table.TableLayoutManager.getNextKnuthElements(T
ableLayoutManager.java:229)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLa
youtManager.java:113)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLa
youtManager.java:113)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLa
youtManager.java:113)
        at
org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements
(BlockStackingLayoutManager.java:284)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLa
youtManager.java:113)
        at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayo
utManager.java:106)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKn
uthElements(PageSequenceLayoutManager.java:272)
        at
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreake
r.java:554)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBl
ockList(PageSequenceLayoutManager.java:264)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:3
01)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:2
63)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSe
quenceLayoutManager.java:157)
        at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java
:385)
        at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:14
8)
        at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.j
ava:378)
        at
org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Transfor
merIdentityImpl.java:1101)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:484)
        at
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
        at
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:160)
        at org.apache.fop.cli.Main.main(Main.java:191)



-----Original Message-----
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 25, 2007 12:28 AM
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: Example of how to use fox:widow-content-limit and
fox:orphan-content-limit

There are a few examples in our test suite:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/sta
ndard-testcases/table_fox_orphan-content-limit_1.xml?view=markup
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/sta
ndard-testcases/table_fox_widow-content-limit_1.xml?view=markup
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/sta
ndard-testcases/table_fox_widow-content-limit_2.xml?view=markup

Documentation:
http://xmlgraphics.apache.org/fop/0.94/extensions.html#widow-orphan-cont
ent-limit

Please note that normal widow/orphan processing is done using normal
XSL-FO properties. The two extension properties here are for special
cases in tables and lists only! If the documentation is not clear
enough,
please tell us what we can do to improve it.

Jeremias Maerki



On 24.10.2007 20:18:26 Jeff Powanda wrote:
> Can someone tell me how to use fox:widow-content-limit and
> fox:orphan-content-limit? I'd like to control widows/orphans in
DocBook
> tables, but I'm not sure how to use these FOP extensions in a DocBook
> template. I'm sending this to both the FOP and DocBook lists.
> 
>  
> 
> Thanks,
> 
> Jeff Powanda
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to