[xep-support] Running XEP in Batch Mode

Michael Sulyaev msulyaev at renderx.com
Wed Feb 13 01:58:18 PST 2008


harvey wrote:
> I am trying to create multiple PDF's from multiple .fo files.  During
> my XSLT conversion I am creating a DOS batch file that can run to
> create the PDF files.
> 
> First I tried:
> 
> C:\Progra~1\RenderX5\XEPWin\xep\xep filename1.fo
> ...
> C:\Progra~1\RenderX5\XEPWin\xep\xep filename#.fo
> 
> The batch file converted first file, then stopped.

Hello Betty,
cmd.exe has a 'for' loop iterating over a set which can be achieved by 
wild carding:
	for %f in (*.fo) do echo %f
Use 'call path/to/xep.bat %f' instead of 'echo %f' to actually call XEP.
If the input files are not all in the same directory you'd need to do 
something like 'find . -name "*.fo"', but I do not know how to say it in 
Windows. Calling one batch file from another requires a 'call' command. 
Try 'call /?' from cmd. I do not know why your batch file stops, you did 
not send the actual file, not the error message if any.

> I then tried:
> 
> java  -jar C:\Progra~1\RenderX5\XEPWin\xep\lib\xep.jar -fo
> htmlfiles/graphics/F664259300-9-ch2-fig2-1.fo
> 
> I get the following error:
> 
> Formatter initialization failed: java.net.MalformedURLException:
> Invalid URL or non-existent file: xep.xml

Look inside xep.bat. You should specify 
-Dcom.renderx.xep.CONFIG=path/to/xep.xml right after 'java', or w/o 
com.renderx.xep prefix if after XSLDriver.

> I have tried adding the classpath into the command and get the same
> error message.

Classpath is of course required, consult xep.bat for syntax and value.

You have XEPWin, so you should better use XSLDriver.exe in your batch 
file or 'for' loop, because you won't waste time on java startup, class 
loading and cache initialization for each input file. For small files 
the performance may increase in times if using XEPWin instead of XEP.

> Anyone have any advice for running XEP from batch?

I've just noticed that you do not actually have xep.bat. Here is a 
minimal sample for reference. Adjust paths to match your site.

set CP=C:\XEP\lib\xep.jar;C:\XEP\lib\saxon.jar;C:\XEP\lib\xt.jar
java -classpath "%CP%" com.renderx.xep.XSLDriver 
"-DCONFIG=C:\XEP\xep.xml" %*

(%* in batch on NT-like system means all arguments given to the batch 
file itself.)

-- 
Best regards,
Michael Sulyaev
http://www.renderx.net
http://www.renderx.com
mailto:support at renderx.com
-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/terms-of-service.html



More information about the Xep-support mailing list