@echo off
setlocal

set binDir=%~dp0
set libDir=%binDir%..\lib

set cp=%libDir%\assembly.jar

rem If you need to use XML catalogs (for example to convert DITA topics 
rem to DocBook topics), 
rem 1) make sure that xmlresolver.jar is found in ../lib/;
rem 2) set environment variable XML_CATALOG_FILES to a list of filenames 
rem or URLs separated by semicolons (;).

if not exist "%libDir%\xmlresolver.jar" goto noresolver
set cp=%cp%;%libDir%\xmlresolver.jar
:noresolver

rem If you prefer to use Saxon 11 (XSLT 3.0 engine; 
rem also works with XSLT 1.0 stylesheets) rather than Java's internal 
rem XSLT 1.0 engine, simply copy its JAR file to ../lib/saxon11.jar.

if not exist "%libDir%\saxon11.jar" goto nosaxon11
set cp=%cp%;%libDir%\saxon11.jar
:nosaxon11

rem If you prefer to use Saxon 6.5.5 (XSLT 1.0 engine) rather than Java's  
rem internal XSLT 1.0 engine, simply copy its JAR file to ../lib/saxon.jar.

if not exist "%libDir%\saxon.jar" goto nosaxon
set cp=%cp%;%libDir%\saxon.jar
:nosaxon

java -Djava.awt.headless=true -Djava.xml.config.file="%binDir%jaxp.properties" -Dxml.catalog.files="%XML_CATALOG_FILES%" -classpath "%cp%;%CLASSPATH%" com.xmlmind.assembly.Processor %*
