Hi Alexey this Exception issue seems to be fixed in FOP 1.0 (I've noticed in the pdf attached to your initial post that you used FOP 0.95). I suggest you to upgrade, at least min-height will work as expected without any Exception.
Pascal Le 14/09/2010 22:10, Alexey Neyman a écrit : > Hi Pascal, > > I see your point, although this advice is not particularly useful to what I > am > doing. As I mentioned, this table is generated by DocBook, and its templates > for tables are probably the most convoluted in the whole stylesheet. I was > trying to avoid heavy customizations of these templates. > > Another issue is that what I really want is "min-height" property in this > case: at XSLT stage, it is not known whether text inside the table cell will > occupy 1, 2, 3 or 15 rows. I tried using min-height in the test case I posted > before, but this causes an exception in FOP (see below). According to spec, > using min-height is perfectly legal: it should set minimum height, while > retaining optimum and maximum height as "auto". > > An finally, what you suggested won't work if another cell is more than 1 row. > With the example I posted: > > AB > AC > DC > > If I set height to 2em, it looks okay. But, if cell B contains a text that > wraps into 2nd line, the table again looks as > > AB > DC > > but now the whole row containing C and D cells is 2em in height. Given that > DocBook stylesheet does not know how many lines of text there will be in each > cell - that is determined by FO processor - I cannot calculate the height > value beforehand. > > So, I tried to set height/min-height on a fo:table-row instead. Setting > min-height= on fo:table-row results in a different exception (also, see > below). Setting height= on fo:table-row does not have any effect at all. > According to XSL-FO spec, block-progression-dimension property (that is set > through height property) is allowed on fo:table-row. Is this a FOP > bug/missing > feature? > > Regards, > Alexey. > > Exception with min-height= on fo:table-cell: > ---->8----->8----->8----->8----->8----->8----->8 > Sep 14, 2010 12:37:47 PM org.apache.fop.cli.Main startFOP > SEVERE: Exception > java.lang.NullPointerException > at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217) > at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) > at org.apache.fop.cli.Main.startFOP(Main.java:166) > at org.apache.fop.cli.Main.main(Main.java:197) > Caused by: java.lang.NullPointerException > at > org.apache.fop.layoutmgr.table.RowGroupLayoutManager.computeRowHeights(RowGroupLayoutManager.java:165) > at > org.apache.fop.layoutmgr.table.RowGroupLayoutManager.createElementsForRowGroup(RowGroupLayoutManager.java:127) > at > org.apache.fop.layoutmgr.table.RowGroupLayoutManager.getNextKnuthElements(RowGroupLayoutManager.java:60) > at > org.apache.fop.layoutmgr.table.TableContentLayoutManager.getKnuthElementsForRowIterator(TableContentLayoutManager.java:220) > at > org.apache.fop.layoutmgr.table.TableContentLayoutManager.getNextKnuthElements(TableContentLayoutManager.java:172) > at > org.apache.fop.layoutmgr.table.TableLayoutManager.getNextKnuthElements(TableLayoutManager.java:247) > at > org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:294) > at > org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116) > at > org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107) > at > org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145) > at > org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552) > at > org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137) > at > org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302) > at > org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264) > at > org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106) > at > org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234) > at > org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123) > at > org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340) > at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169) > at > org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102) > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > Source) > at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown > Source) > at > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown > > Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown > 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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown > Source) > at > org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) > at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) > ... 3 more > ---->8----->8----->8----->8----->8----->8----->8 > > > Exception with min-height= on fo:table-row: > ---->8----->8----->8----->8----->8----->8----->8 > Sep 14, 2010 12:53:10 PM org.apache.fop.cli.Main startFOP > SEVERE: Exception > java.lang.NullPointerException > at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217) > at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125) > at org.apache.fop.cli.Main.startFOP(Main.java:166) > at org.apache.fop.cli.Main.main(Main.java:197) > Caused by: java.lang.NullPointerException > at > org.apache.fop.layoutmgr.MinOptMaxUtil.toMinOptMax(MinOptMaxUtil.java:106) > at > org.apache.fop.layoutmgr.table.RowGroupLayoutManager.computeRowHeights(RowGroupLayoutManager.java:155) > at > org.apache.fop.layoutmgr.table.RowGroupLayoutManager.createElementsForRowGroup(RowGroupLayoutManager.java:127) > at > org.apache.fop.layoutmgr.table.RowGroupLayoutManager.getNextKnuthElements(RowGroupLayoutManager.java:60) > at > org.apache.fop.layoutmgr.table.TableContentLayoutManager.getKnuthElementsForRowIterator(TableContentLayoutManager.java:220) > at > org.apache.fop.layoutmgr.table.TableContentLayoutManager.getNextKnuthElements(TableContentLayoutManager.java:172) > at > org.apache.fop.layoutmgr.table.TableLayoutManager.getNextKnuthElements(TableLayoutManager.java:247) > at > org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:294) > at > org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116) > at > org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107) > at > org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145) > at > org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552) > at > org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137) > at > org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302) > at > org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264) > at > org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106) > at > org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234) > at > org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123) > at > org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340) > at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169) > at > org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102) > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > Source) > at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown > Source) > at > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown > > Source) > at > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown > 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.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown > Source) > at > org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) > at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214) > ... 3 more > ---->8----->8----->8----->8----->8----->8----->8 > > On Tuesday, September 14, 2010 01:04:02 am Pascal Sancho wrote: >> Hi, >> I think the behaviour is correct here: >> Cells height is not sufficient to see the effect you want. >> try to increase the height of vertically spanned cells (by setting the >> height property to 2em) and you will see what I mean. >> >> Pascal >> >> Le 13/09/2010 22:39, Alexey Neyman a écrit : >>> <fo:table table-layout="fixed" width="100%" >>> >>> border-top="solid black 0.5pt" border-left="solid black 0.5pt"> >>> >>> <fo:table-body> >>> >>> <fo:table-row> >>> >>> <fo:table-cell border-bottom="solid black 0.5pt" >>> >>> border-right="solid black 0.5pt" >>> number-rows-spanned="2" >>> number-columns-spanned="2"> >>> >>> <fo:block>A</fo:block> >>> >>> </fo:table-cell> >>> <fo:table-cell border-bottom="solid black 0.5pt" >>> >>> border-right="solid black 0.5pt"> >>> >>> <fo:block>B</fo:block> >>> >>> </fo:table-cell> >>> >>> </fo:table-row> >>> <fo:table-row> >>> >>> <fo:table-cell border-bottom="solid black 0.5pt" >>> >>> border-right="solid black 0.5pt" number-rows-spanned="2"> >>> >>> <fo:block>C</fo:block> >>> >>> </fo:table-cell> >>> >>> </fo:table-row> >>> <fo:table-row> >>> >>> <fo:table-cell border-bottom="solid black 0.5pt" >>> >>> border-right="solid black 0.5pt"> >>> >>> <fo:block>D</fo:block> >>> >>> </fo:table-cell> >>> <fo:table-cell border-bottom="solid black 0.5pt" >>> >>> border-right="solid black 0.5pt"> >>> >>> <fo:block>E</fo:block> >>> >>> </fo:table-cell> >>> >>> </fo:table-row> >>> >>> </fo:table-body> >>> >>> </fo:table> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
