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 Elmström Johan <Jo...@edb.com> on 2005/12/05 11:25:12 UTC

FW: Translet class format error

As suspected...

Unfortunately I'm having some problems setting up my templates, and I can't find any good examples.

I keep getting an exception 'element xsl:template not allowed in this position', but as soon as I move it, I get an exception saying element fo: is not bound.

I'm trying to create several templates which each build a <fo:table> an put these inside a main template.


Below is the .fo I'm trying to build. Can anyone tell me what its supposed to look like??

Thanks

/Johan

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:decimal-format name="standard" decimal-separator="," grouping-separator="." infinity="INFINITY" minus-sign="-" NaN="ogiltigt nummer" percent="%" per-mille="m" zero-digit="0" digit="#" pattern-separator=";"/>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<fo:layout-master-set>
      	<fo:simple-page-master master-name="content"
	    	margin-right="5mm" margin-left="5mm" 
			margin-bottom="5mm" margin-top="5mm"
	      	page-width="210mm" page-height="297mm">
      		<fo:region-body margin-top="20mm" margin-bottom="20mm"/>
      		<fo:region-before extent="20mm"/>
      		<fo:region-after extent="20mm"/>
      	</fo:simple-page-master>
	</fo:layout-master-set>
	<fo:page-sequence master-reference="content">
		<fo:flow flow-name="xsl-region-body">
			<xsl:template match="/">
			<fo:table table-layout="fixed" inline-progression-dimension.optimum="200mm" font-size="10px">
				<fo:table-column column-width="200mm" column-number="1" />
				<fo:table-body start-indent="0px" text-align="start">
 					<fo:table-row>
 						<fo:table-cell>
             					<xsl:apply-templates select="tableTemplate" mode="blind"/>
           				</fo:table-cell>
 					</fo:table-row>
 				</fo:table-body>
      			</fo:table>
      			</xsl:template>
      			<xsl:template match="tableTemplate" mode="blind">
			   <fo:table table-layout="fixed" width="100%">
			      <fo:table-column column-width="proportional-column-width(1)"/>
			      <fo:table-body>
			         <fo:table-row padding-bottom="0.5mm">
			            <fo:table-cell>
			               <fo:block font-family="Times Roman"
			                         font-style="italic"
			                         font-size="8pt">
			                         TEST
			               </fo:block>
			            </fo:table-cell>
			         </fo:table-row>
			         <fo:table-row keep-with-previous="always">
			            <fo:table-cell>
			               <fo:block>
			                  TEMPLATE 
			                </fo:block>
			            </fo:table-cell>
			         </fo:table-row>
			     </fo:table-body>
			  </fo:table>
			</xsl:template> 
		</fo:flow>
	</fo:page-sequence>
</fo:root>
</xsl:stylesheet>



-----Original Message-----
From: Henry Zongaro [mailto:zongaro@ca.ibm.com] 
Sent: den 5 december 2005 11:15
To: Elmström Johan
Cc: news; xalan-j-users@xml.apache.org
Subject: Re: Translet class format error

Hi, Johan.

news <ne...@sea.gmane.org> wrote on 2005-12-05 03:19:07 AM:
> I'm running into some problems when I'm trying to parse my xsl (xsl:fo 
to be
> precise). Has anyone encountered this before ? How would I get around 
it?
> I hope extracting some elements into templates might do the trick, but 
I'm not
> optimistic... (maybe the translet is compiled differently then)
...
> Exception in thread "main" java.lang.ClassFormatError: translet_out 
(Code of a
> method longer than 65535 bytes)

     The JVM specification restricts methods in classes to fewer than 
65536 bytes in length.  When XSLTC generates translet classes, it 
sometimes creates methods that surpass that limit, which results in the 
ClassFormatError you see when the JVM attempts to load the class.

     This is a known problem.  Until we have a fix for it (which I'm 
hoping will be this month) your only recourse is to try to restructure 
your stylesheet by making some of the templates smaller - "extracting some 
elements into templates," as you guessed.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      Xalan development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com




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


Re: Translet class format error

Posted by Johan <jo...@edb.com>.
Yeah, I'm sorry about that one, I was still using the TraxInputHandler rather
than the TransformerImpl to transform the xsl. 
Once I switched back, there were no complaints.


Regards

/Johan


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


Re: Translet class format error

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 05.12.2005 12:16:00 Andreas L Delmelle wrote:
> On Dec 5, 2005, at 11:25, Elmström Johan wrote:
> 
> > Unfortunately I'm having some problems setting up my templates, and  
> > I can't find any good examples.
> >
> > I keep getting an exception 'element xsl:template not allowed in  
> > this position', but as soon as I move it, I get an exception saying  
> > element fo: is not bound.
> 
> Errm... I fear you're somewhat missing the point, but that's OK.  
> That's why we're here :-) Although the Mulberry XSLT list is far  
> better suited for XSLT-related questions.
> 
> >
> > I'm trying to create several templates which each build a  
> > <fo:table> an put these inside a main template.
> 
> There should be at least an xsl:template that constructs the fo:root  
> (possibly including the layout-master-set). So, roughly...

...and it is a good idea to move the namespace declaration for the "fo"
prefix to the xsl:stylesheet element. Otherwise, you'll run into
namespace problems in further xsl:templates.

<snip/>


Jeremias Maerki


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


Re: Translet class format error

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Dec 5, 2005, at 11:25, Elmström Johan wrote:

> Unfortunately I'm having some problems setting up my templates, and  
> I can't find any good examples.
>
> I keep getting an exception 'element xsl:template not allowed in  
> this position', but as soon as I move it, I get an exception saying  
> element fo: is not bound.

Errm... I fear you're somewhat missing the point, but that's OK.  
That's why we're here :-) Although the Mulberry XSLT list is far  
better suited for XSLT-related questions.

>
> I'm trying to create several templates which each build a  
> <fo:table> an put these inside a main template.

There should be at least an xsl:template that constructs the fo:root  
(possibly including the layout-master-set). So, roughly...

>
> <?xml version="1.0"?>
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
> version="1.0">
> <xsl:decimal-format name="standard" decimal-separator="," grouping- 
> separator="." infinity="INFINITY" minus-sign="-" NaN="ogiltigt  
> nummer" percent="%" per-mille="m" zero-digit="0" digit="#" pattern- 
> separator=";"/>

<xsl:template match="/">
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> 	<fo:layout-master-set>
>       	<fo:simple-page-master master-name="content"
> 	    	margin-right="5mm" margin-left="5mm"
> 			margin-bottom="5mm" margin-top="5mm"
> 	      	page-width="210mm" page-height="297mm">
>       		<fo:region-body margin-top="20mm" margin-bottom="20mm"/>
>       		<fo:region-before extent="20mm"/>
>       		<fo:region-after extent="20mm"/>
>       	</fo:simple-page-master>
> 	</fo:layout-master-set>
> <fo:page-sequence master-reference="content">
>   <fo:flow flow-name="xsl-region-body">
>        <fo:table table-layout="fixed" inline-progression- 
> dimension.optimum="200mm" font-size="10px">
> 	<fo:table-column column-width="200mm" column-number="1" />
> 	<fo:table-body start-indent="0px" text-align="start">
>             <fo:table-row>
>               <fo:table-cell>
> 		<xsl:apply-templates select="tableTemplate" mode="blind"/>
>               </fo:table-cell>
>  	    </fo:table-row>
>  	  </fo:table-body>
>       	</fo:table>
>       </fo:flow>
>     </fo:page-sequence>
>   </fo:root>
> </xsl:template>

> <xsl:template match="tableTemplate" mode="blind">
>   <fo:table table-layout="fixed" width="100%">
>     <fo:table-column column-width="proportional-column-width(1)"/>
>       <fo:table-body>
>         <fo:table-row padding-bottom="0.5mm">
>           <fo:table-cell>
>             <fo:block font-family="Times Roman"
>               font-style="italic"
>               font-size="8pt">
>                       TEST
>             </fo:block>
>           </fo:table-cell>
>         </fo:table-row>
>         <fo:table-row keep-with-previous="always">
>           <fo:table-cell>
>             <fo:block>
>                 TEMPLATE
>             </fo:block>
>           </fo:table-cell>
>         </fo:table-row>
>      </fo:table-body>
>   </fo:table>
> </xsl:template>
> </xsl:stylesheet>

HTH!

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