Currently we use Cocoon2 to publish reports. Everything works fine as long
as there is XML data in the XML file that is dynamically generated. But when
there is no data, I get an exception on the WebServer console as below:

java.lang.RuntimeException: org.apache.fop.apps.FOPException: fo:flow must
contain block-level children
        at
org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3231)
        at java.lang.Thread.run(Thread.java:484)

Here is the snippet of the XSL I use for processing the XML data:

 <fo:flow flow-name="xsl-region-body">
                            <xsl:apply-templates select="LogMessage" />
 </fo:flow>

As long as the tag LogMessage exists in the XML data file, everything  works
as designed but if the LogMessage tag does not exist because there are no
log messages, I get the above exception. Is there a way, to just publish an
empty report with just the Column headers if there is no LogMessage tag in
the XML data file . How would I modify the above snippet? I appreciate any
help on this issue.

Thanks.
Prabhakar


Reply via email to