@echo off
setlocal

set dist=%~dp0

set jars=%dist%\xerces.jar;%dist%\resolver.jar;%dist%\relaxng.jar

if exist "%dist%\xxe.jar" goto jar
set cp=%dist%\..\class;%jars%
goto fi
:jar
set cp=%dist%\xxe.jar;%jars%
:fi

set catalog=%dist%\..\addon\config\catalog.xml
if exist "%catalog%" set XML_CATALOG_FILES=%catalog%;%XML_CATALOG_FILES%

if exist "%dist%\jre\bin\java.exe" goto privatejre
set java=java
goto fi2
:privatejre
set java=%dist%\jre\bin\java.exe
:fi2

"%java%" -Dxml.catalog.files="%XML_CATALOG_FILES%" -Xss4m -Xmx512m -classpath "%cp%;%CLASSPATH%" com.xmlmind.xml.xmltool.Main %*

endlocal
