You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by pkrishnaswami <pk...@learnframe.com> on 2002/06/12 21:18:16 UTC

RE:How do you create an empty report

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



Re: How do you create an empty report

Posted by "J.Pietschmann" <j3...@yahoo.de>.
pkrishnaswami wrote:
> 
> 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.

Another possibility is to add an mpty block at the end:

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

J.Pietschmann


Re: How do you create an empty report

Posted by Oleg Tkachenko <ol...@multiconn.com>.
pkrishnaswami wrote:

 > 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.

Just give to fop what it wants - <fo:block> in any case.
<fo:flow flow-name="xsl-region-body">
	<fo:block>
   		<xsl:apply-templates select="LogMessage" />
	</fo:block>
</fo:flow>

-- 
Oleg Tkachenko
Multiconn International Ltd