[
https://issues.apache.org/jira/browse/FOP-3069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Kainzbauer updated FOP-3069:
------------------------------------
Description:
+_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}<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4-main" page-width="210mm"
page-height="297mm">
<fo:region-body margin-bottom="10mm" margin-left="20mm" margin-right="5mm"
margin-top="10mm"/>
<fo:region-before extent="10mm" region-name="main-reg-before"/>
<fo:region-after extent="10mm" region-name="main-reg-after"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="basic">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="A4-main"
page-position="any"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="basic">
<fo:static-content flow-name="main-reg-before">
<fo:block/>
</fo:static-content>
<fo:static-content flow-name="main-reg-after">
<fo:block/>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block-container>
<fo:block-container>
<fo:table>
<fo:table-body/>
</fo:table>
</fo:block-container>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>{quote}
was:
+_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}
> 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}<?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="A4-main" page-width="210mm"
> page-height="297mm">
> <fo:region-body margin-bottom="10mm" margin-left="20mm" margin-right="5mm"
> margin-top="10mm"/>
> <fo:region-before extent="10mm" region-name="main-reg-before"/>
> <fo:region-after extent="10mm" region-name="main-reg-after"/>
> </fo:simple-page-master>
> <fo:page-sequence-master master-name="basic">
> <fo:repeatable-page-master-alternatives>
> <fo:conditional-page-master-reference master-reference="A4-main"
> page-position="any"/>
> </fo:repeatable-page-master-alternatives>
> </fo:page-sequence-master>
> </fo:layout-master-set>
> <fo:page-sequence master-reference="basic">
> <fo:static-content flow-name="main-reg-before">
> <fo:block/>
> </fo:static-content>
> <fo:static-content flow-name="main-reg-after">
> <fo:block/>
> </fo:static-content>
> <fo:flow flow-name="xsl-region-body">
> <fo:block-container>
> <fo:block-container>
> <fo:table>
> <fo:table-body/>
> </fo:table>
> </fo:block-container>
> </fo:block-container>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>{quote}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)