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 Georg Horisberger <ho...@bpm.ch> on 2005/12/19 09:50:36 UTC

Problem with FOP-0.90a

We are using FOP (on SUSE Linux 9.2) to generate PDFs from an XML data file and an XSL stylesheet (generated with XSLfast). Pretty much the common task of FOP, I guess.

WIth FOP-0.20 it worked perfectly. Now we are trying to do the same job with FOP-0.90a (with the objective to produce some RTF output later on). What we get is just a bunch of errors (see below) and an empty PDF file. 

Any ideas? Thank you very much.

Georg

# java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
# cd /usr/local/fop-0.90alpha1
# ./fop -c cfg.xml -xml PrintData.xml -xsl StyleSheet.xsl -pdf Test.pdf
Initializing User Agent Configuration
[Error] StyleSheet.xsl:23:245: Element type "xsl:stylesheet" must be declared.
[Error] StyleSheet.xsl:25:31: Element type "xsl:variable" must be declared.
[Error] StyleSheet.xsl:26:34: Element type "xsl:variable" must be declared.
[Error] StyleSheet.xsl:27:34: Element type "xsl:template" must be declared.
[Error] StyleSheet.xsl:28:55: Element type "fo:root" must be declared.
[Error] StyleSheet.xsl:29:23: Element type "fo:layout-master-set" must be declared.
[Error] StyleSheet.xsl:30:179: Element type "fo:simple-page-master" must be declared.
[Error] StyleSheet.xsl:31:105: Element type "fo:region-body" must be declared.
...
[Error] StyleSheet.xsl:49:169: Element type "fo:block" must be declared.
[Error] StyleSheet.xsl:50:90: Element type "fo:block" must be declared.
[Error] StyleSheet.xsl:51:67: Element type "fo:inline" must be declared.
[Error] StyleSheet.xsl:52:11: Element type "xsl:text" must be declared.
[Error] StyleSheet.xsl:56:119: Element type "fo:block-container" must be declared.
...
Mismatch: static-content (http://www.w3.org/1999/XSL/Format) vs. page-sequence (http://www.w3.org/1999/XSL/Format)
Mismatch: static-content (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format)
Exception
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Error(Unknown location): fo:static-content is missing child elements.
Required Content Model: (%block;)+
 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem with FOP-0.90a

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 19.12.2005 09:50:36 Georg Horisberger wrote:
> 
> We are using FOP (on SUSE Linux 9.2) to generate PDFs from an XML data
> file and an XSL stylesheet (generated with XSLfast). Pretty much the
> common task of FOP, I guess.
> 
> WIth FOP-0.20 it worked perfectly. Now we are trying to do the same job
> with FOP-0.90a (with the objective to produce some RTF output later on).
> What we get is just a bunch of errors (see below) and an empty PDF file. 

The fact that in an error condition an empty PDF file remains has
recently been fixed. This will be in the next release.

> Any ideas? Thank you very much.
> 
> Georg
> 
> # java -version
> java version "1.4.2_08"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
> Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
> # cd /usr/local/fop-0.90alpha1
> # ./fop -c cfg.xml -xml PrintData.xml -xsl StyleSheet.xsl -pdf Test.pdf
> Initializing User Agent Configuration
> [Error] StyleSheet.xsl:23:245: Element type "xsl:stylesheet" must be declared.
> [Error] StyleSheet.xsl:25:31: Element type "xsl:variable" must be declared.
> [Error] StyleSheet.xsl:26:34: Element type "xsl:variable" must be declared.
> [Error] StyleSheet.xsl:27:34: Element type "xsl:template" must be declared.
> [Error] StyleSheet.xsl:28:55: Element type "fo:root" must be declared.
> [Error] StyleSheet.xsl:29:23: Element type "fo:layout-master-set" must be declared.
> [Error] StyleSheet.xsl:30:179: Element type "fo:simple-page-master" must be declared.
> [Error] StyleSheet.xsl:31:105: Element type "fo:region-body" must be declared.
> ...
> [Error] StyleSheet.xsl:49:169: Element type "fo:block" must be declared.
> [Error] StyleSheet.xsl:50:90: Element type "fo:block" must be declared.
> [Error] StyleSheet.xsl:51:67: Element type "fo:inline" must be declared.
> [Error] StyleSheet.xsl:52:11: Element type "xsl:text" must be declared.
> [Error] StyleSheet.xsl:56:119: Element type "fo:block-container" must be declared.
> ...

The above doesn't appear to come from FOP but from the XSLT processor.
Please run the XSLT step separately from FOP ("-foout Test.fo" instead
of "-pdf Test.pdf") and check the FO output.

> Mismatch: static-content (http://www.w3.org/1999/XSL/Format) vs. page-sequence (http://www.w3.org/1999/XSL/Format)
> Mismatch: static-content (http://www.w3.org/1999/XSL/Format) vs. root (http://www.w3.org/1999/XSL/Format)

This could be warnings caused by the earlier XSL transformation. If the
FO is correct, then maybe something's wrong in FOP. If you post your FO
file I can have a look.

> Exception
> javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: Error(Unknown location): fo:static-content is missing child elements.
> Required Content Model: (%block;)+

This, on the other side, indicates that your FO is incomplete. As
decribed in [1], the new FOP is much more strict about the
interpretation of the specification.

[1] http://xmlgraphics.apache.org/fop/0.90/upgrading.html

You can't have:

<fo:static-content flow-name="xsl-region-before"/>

According to the spec, this must be at least

<fo:static-content flow-name="xsl-region-before">
  <fo:block/>
</fo:static-content>

Since you indicate that you're working with XSLFast to generate the
stylesheets, this may indicate that XSLFast does not generate proper
XSL-FO code. FOP 0.20.5 was much more forgiving here. We have a switch
in 0.90 that enabled "relaxed validation" but unfortunately, this option
does not catch this particular problem. You will have to modify the
generated stylesheet manually and ask jCatalog to fix their software.
Another (additional) option is to update the FOP source code to respect
the "relaxed validation" flag for empty static-content nodes.

I hope that helps.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org