V. S. wrote:
When converting FO to DOCX, the following FO input fails with 
java.util.NoSuchElementException

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
   <fo:layout-master-set>
     <fo:simple-page-master master-name="simple"
                            page-height="11in"
                            page-width="8.5in"
                            margin="0.5in">
       <fo:region-body/>
     </fo:simple-page-master>
   </fo:layout-master-set>

   <fo:page-sequence master-reference="simple">
     <fo:flow flow-name="xsl-region-body">
       <fo:table border-collapse="collapse" table-layout="fixed">
         <fo:table-body>
           <fo:table-row>
             <fo:table-cell>
               <fo:list-block margin-left="0.25cm"/>
             </fo:table-cell>
           </fo:table-row>
         </fo:table-body>
       </fo:table>
     </fo:flow>
   </fo:page-sequence>
</fo:root>
Yes. We were able to reproduce this bug thanks to the sample XSL-FO you sent us.

Note that FOP chokes too when processing your sample and its error message is somewhat clearer than ours:

---
fop Bug.fo Bug.pdf

[ERROR] InputHandler - javax.xml.transform.TransformerException: file:/home/hussein/tmp/Bug.fo:17:52: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 17:52)

[ERROR] FOP - Exception <org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:list-block" is missing child elements. Required content model: marker* (list-item)+ (See position 17:52)
---

It's clearly an XFC bug. XFC is not supposed to crash even if the input XSL-FO is invalid (the content model of fo:list-block is (list-item+); see https://www.w3.org/TR/2001/REC-xsl-20011015/slice6.html#fo_list-block)

We have fixed this bug (for now, just for the DOCX output format). As of version 6.6.1 (to be released), XFC will (1) report a "ignoring invalid empty fo:list-block" warning and (2) just ignore the empty fo:list-block. Meanwhile, we recommend not to use empty fo:list-blocks.



--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support

Reply via email to