You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Aurélien DEHAY <au...@sncf.fr> on 2000/11/06 14:17:31 UTC

FOP problem.

Hello everybody.

I've got an error with FOP. I haven't look at the archives, but they
are unreacheable. Here is my problem.

I wan't to use a XSL to generate an FO file. But I've got an error I
can't (or don't know) solve:

java.lang.NullPointerException at
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java,
Compiled Code)

In the log I've got the following error:

WARNING: Unknown formatting object ^fo:root

Here is my XSL file:

========================================

<?xml version="1.0"?>
  <xsl:stylesheet 
	 xmlns:fo="http://www.w3.org/1999/XSL/Format"
	 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	 >

	 <xsl:template match="/">
		<xsl:processing-instruction name="cocoon-format">type="text/xslfo"</xsl:processing-instruction>
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
		  
		  <fo:layout-master-set>
			 <fo:simple-page-master master-name="first"
				page-height="29.7cm"
				page-width="21cm"
				margin-top="1cm"
				margin-bottom="2cm"
				margin-left="2.5cm"
				margin-right="2.5cm">
				<fo:region-before extent="3cm"/>
				<fo:region-body margin-top="3cm"/>
				<fo:region-after extent="1.5cm"/>
			 </fo:simple-page-master>
			 
			 <fo:page-sequence-master master-name="all">
				<fo:repeatable-page-master-alternatives>
				  <fo:conditional-page-master-reference master-name="page" page-position="first"/>
				</fo:repeatable-page-master-alternatives>
			 </fo:page-sequence-master>
		  </fo:layout-master-set>
		  
		  <fo:page-sequence master-name="all">
			 
			 <fo:static-content flow-name="xsl-region-before">
				<fo:block text-align="center" font-size="10pt">page <fo:page-number/></fo:block>
			 </fo:static-content>
			 
			 <fo:flow flow-name="xsl-region-body">
				<xsl:apply-templates/>
			 </fo:flow>
			 
		  </fo:page-sequence>
		  
		</fo:root>
	 </xsl:template>
	 
	 <xsl:template match="document">
		<fo:block font-size="36pt"><xsl:value-of select="@titre"/></fo:block>
	 </xsl:template>
  </xsl:stylesheet>

========================================

I've got fop1.0[dev] and Xerces 1.1.3 with Cocoon 1.7.4.
Any help will be welcome.

Thanks.
-- 
Aurélien