Search code examples
xsltbatch-fileapache-fop

running a batch file using xsl and fop....Problems with the fop


I am running my simple little batch program:

@echo off

transform data_files\sql_dump data_files\sql_to_xml transformed_files\sql_dump_to_xml
transform transformed_files\sql_dump_to_xml data_files\convert_to_html_amt transformed_files\converted_to_html_amount html
transform transformed_files\sql_dump_to_xml data_files\convert_to_html_date transformed_files\converted_to_html_date html
transform transformed_files\sql_dump_to_xml data_files\convert_to_html_sperson transformed_files\converted_to_html_salesperson html
transform transformed_files\sql_dump_to_xml data_files\convert_to_fo transformed_files\converted_to_fo fo
fop transformed_files\converted_to_fo.fo transformed_files\converted.png
fop transformed_files\converted_to_fo.fo transformed_files\converted.pdf
fop transformed_files\converted_to_fo.fo transformed_files\converted.rtf

For some reason, all expected files show up, save for the last two. Why would that be?


Solution

  • In windows, FOP is a BAT file and not an EXE file.

    To invoke it from a batch file, you should

    1. either use CALL FOP or

    2. as an alternative you can run java -jar path/to/fop/fop.jar, relying on FOP to build the classpath for running FOP dynamically.

    Read HELP CALL and read FOP documentation.