[ 
https://issues.apache.org/jira/browse/FOP-3069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17537461#comment-17537461
 ] 

Michael Kainzbauer commented on FOP-3069:
-----------------------------------------

I know the xml FO is incorrect and how to get it rendered correctly. But this 
doesn't solve the issue. The issue is: no input should cause the program to 
loop forever, regardless if the input is well formed, or not. If the input 
can't be rendered, it should terminate throwing an exception. It must not run 
infinitely!

> Empty <fo:table.body> results in infinite loop when strict-validation is set 
> to false
> -------------------------------------------------------------------------------------
>
>                 Key: FOP-3069
>                 URL: https://issues.apache.org/jira/browse/FOP-3069
>             Project: FOP
>          Issue Type: Bug
>          Components: fo/unqualified
>    Affects Versions: 1.1, 2.0, 2.1, 2.2, 2.3, 2.4, 2.6, 2.7
>            Reporter: Michael Kainzbauer
>            Priority: Major
>
> +_Since Apache FOP 1.1 (not reproducible in 1.0)_+
> When disabling strict-validation, ApacheFOP will loop infinitely when a 
> <fo:table.body> is empty, e.g.: <fo:table.body/>
> As a result in class
> {color:#57d9a3}org.apache.fop.layoutmgr.BlockContainerLayoutManager.getNextKnuthElements(LayoutContext
>  context, int alignment);{color}
> (line 111)
> is called infinitely.
> Yes, the XML-FO is incorrect and not according to the standard, but this is 
> an issue that can cause real trouble when the given conditions are met. 
> Turning on strict-validation will result in an error with a clear and 
> understandable error message:
> {quote}{color:#57d9a3}{{Error on line 26 column 29 }}{color}
> {color:#57d9a3}{{  SXCH0003  org.apache.fop.fo.ValidationException: 
> "fo:table-body" is missing child}}{color}
> {color:#57d9a3}{{  elements. Required content model: marker* 
> (table-row+|table-cell+) (Siehe Position 26:29).}}{color}
> {color:#57d9a3}{{  Caused by org.apache.fop.fo.ValidationException: 
> null:26:29: "fo:table-body" is missing}}{color}
> {color:#57d9a3}{{  child elements. Required content model: marker* 
> (table-row+|table-cell+) (See position 26:29)}}{color}
> {quote}
> Example XML-FO:
> {quote}{{{color:#57d9a3}<?xml version="1.0" encoding="UTF-8"?>{color}}}
> {{{color:#57d9a3}<fo:root 
> xmlns:fo="http://www.w3.org/1999/XSL/Format";>{color}}}
> {{{color:#57d9a3} <fo:layout-master-set>{color}}}
> {{{color:#57d9a3} <fo:simple-page-master master-name="A4-main" 
> page-width="210mm" page-height="297mm">{color}}}
> {{{color:#57d9a3} <fo:region-body margin-bottom="10mm" margin-left="20mm" 
> margin-right="5mm" margin-top="10mm"/>{color}}}
> {{{color:#57d9a3} <fo:region-before extent="10mm" 
> region-name="main-reg-before"/>{color}}}
> {{{color:#57d9a3} <fo:region-after extent="10mm" 
> region-name="main-reg-after"/>{color}}}
> {{{color:#57d9a3} </fo:simple-page-master>{color}}}
> {{{color:#57d9a3} <fo:page-sequence-master master-name="basic">{color}}}
> {{{color:#57d9a3} <fo:repeatable-page-master-alternatives>{color}}}
> {{{color:#57d9a3} <fo:conditional-page-master-reference 
> master-reference="A4-main" page-position="any"/>{color}}}
> {{{color:#57d9a3} </fo:repeatable-page-master-alternatives>{color}}}
> {{{color:#57d9a3} </fo:page-sequence-master>{color}}}
> {{{color:#57d9a3} </fo:layout-master-set>{color}}}
> {{{color:#57d9a3} <fo:page-sequence master-reference="basic">{color}}}
> {{{color:#57d9a3} <fo:static-content flow-name="main-reg-before">{color}}}
> {{{color:#57d9a3} <fo:block/>{color}}}
> {{{color:#57d9a3} </fo:static-content>{color}}}
> {{{color:#57d9a3} <fo:static-content flow-name="main-reg-after">{color}}}
> {{{color:#57d9a3} <fo:block/>{color}}}
> {{{color:#57d9a3} </fo:static-content>{color}}}
> {{{color:#57d9a3} <fo:flow flow-name="xsl-region-body">{color}}}
> {{{color:#57d9a3} <fo:block-container>{color}}}
> {{{color:#57d9a3} <fo:table>{color}}}
> {{{color:#57d9a3} <fo:table-body/>{color}}}
> {{{color:#57d9a3} </fo:table>{color}}}
> {{{color:#57d9a3} </fo:block-container>{color}}}
> {{{color:#57d9a3} </fo:flow>{color}}}
> {{{color:#57d9a3} </fo:page-sequence>{color}}}
> {{{color:#57d9a3}</fo:root>{color}}}
> {quote}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to