From: Jeremias M. <de...@je...> - 2011-08-23 06:06:22
|
Hi Grégory I assume it's a classpath problem. Please make sure you have both Xalan-J and Barcode4J in the "xslt" task's classloader. I'd try one of these two approaches: 1. Copy barcode4j.jar in Ant's lib directory. 2. Use the "classpath" nested element to explicitely specify Xalan-J and Barcode4J for the classpath for the xslt task. http://ant.apache.org/manual/Tasks/style.html HTH On 21.08.2011 18:09:15 Grégory Roche wrote: > > > Hello, > > I'm looking for to implement an simple task in a script build.xml for building a PDF : > > <target name="barcode4j-examples"> > > <!-- xml to fo with xalan 2.7 --> > <xslt in="${examples.dir}/barcode4j/barcodes.xml" out="${examples.dir}/barcode4j/barcodes.fo" > style="${examples.dir}/barcode4j/barcodes2xsl-fo.xsl" extension=".fo"> > <outputproperty name="method" value="xml"/> > <outputproperty name="standalone" value="yes"/> > <outputproperty name="encoding" value="UTF-8"/> > <outputproperty name="indent" value="yes"/> > </xslt> > > <!-- fo to pdf with fop 1.0 --> > > <fop format="application/pdf" > fofile="${examples.dir}/barcode4j/barcodes.fo" > outfile="${examples.dir}/barcode4j/barcodes.pdf"/> > > </target> > > but Ant return the error bellow : > > [xslt] Processing C:\Users\greg\projets\counter\examples\barcode4j\barcodes.xml to C:\Users\greg\projets\counter\examples\barcode4j\barcodes.fo > [xslt] Loading stylesheet C:\Users\greg\projets\counter\examples\barcode4j\barcodes2xsl-fo.xsl > [xslt] : Error! Le premier argument de la fonction Java non static 'generate' n'est pas une référence d'objet valide. > [xslt] : Error! Le premier argument de la fonction Java non static 'generate' n'est pas une référence d'objet valide. > [xslt] : Error! Le premier argument de la fonction Java non static 'generate' n'est pas une référence d'objet valide. > [xslt] : Error! Erreur de contrôle du type de l'expression 'FilterParentPath(variable-ref(bc/void), ParentLocationPath(step("child", 21), step("attribute", 22)))'. > [xslt] : Fatal Error! Impossible de compiler la feuille de style > [xslt] Failed to process C:\Users\greg\projets\counter\examples\barcode4j\barcodes.xml > > There is a problem with the function java "generate" but I don't know why ! Have you an idea ? Thank for you help. > > www.polymorphisme.com > web...@po... > fixe : +33 (0)5.24.07.64.02 > port : +33 (0)6.89.54.14.84 Jeremias Maerki |