Thanks Victor for the reply, but I think this don't solve my problem. I will try to explain it better.

I have a directory tree with various folders with diferent depth. On this diferent folders I have .xml files that i will translate to html and .fo files with an xsl file and then from .fo to .pdf with Fop. (This work is for the spanish Java Site www.javahispano.org, and this ant script translate the xml public articles to diferents formats)

I would like to get the xml, html, fo and pdf in the same folder, with their external files, like images, on a subfolder.

I'm making all the translations process with ant, and the Fop Task take as base dir, if you use filesets, the base directory of the file set. If we see the soruce:

<fop format="application/pdf" outdir="${dir.salida.pdf}"
           messagelevel="debug">
           <fileset dir="${dir.salida.fo}">
                <include name="**/*.fo"/>
           </fileset>
       </fop>

In this case, to Fop the base dir will be dir.salida.fo, but if i have relative path to external files in the .fo files,

<fo:external-graphic src="file:./imagenes/org_javahispano_ejemplos_slsb_classes.gif"/>

Fop will not find the image.

So waht i need is to change the base dir directory for each . fo file of the fileset.

What i did is to extend the Fop Task to replace this behaviour. I take the Fop 0.20.5 version becouse i have problem with the latest nigthly bluid.

This is the little change i make,  near line 250

fileSetFOFileBaseURL =f.getParentFile().toURL().toExternalForm();
Configuration.put("baseDir",fileSetFOFileBaseURL);

I get as basedir the parenFile of the "f", the .fo file of the fileset.

Maybe it will be a good idea to add this configuration to the "Key-Value Configuration Options". I think this have sense becouse if the .fo file is the source of the translation its folder should be the basedir of the translation.

Regards, Enrique.



Victor Mote wrote:

Enrique Rodriguez wrote:



I'm making  one Ant script that convert many xml file to html and pdf.

I've a litlle proble one i convert the xml file to pdf with the external
resources (iamges). The script catch the base url as the base dir of the
fileset but i think it's better if the base dir would be the folder that
contain the .fo file.

Anybody think the same as me???



See: http://xml.apache.org/fop/anttask.html#Parameters+for+FOP+Ant+task where the "userconfig" parameter/attribute is discussed. Then see: http://xml.apache.org/fop/configuration.html#summary-key-value where the "basedir" configuration option is discussed. Between the two, I think you should be able to set the base directory to anything you want.

Victor Mote


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to