@echo off
setlocal

set dist=%~dp0

set jars=%dist%\xp.jar;%dist%\resolver.jar

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

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

rem -Xss1m is needed to support *really* large XML-Schemas
rem -Xmx128m is needed from Java[tm] 1.4.2 which by default sets this to 64m

java -Dxml.catalog.files="%XML_CATALOG_FILES%" -Xss1m -Xmx128m -classpath "%cp%" com.xmlmind.xmledit.xsd.load.Validate %*

endlocal
