@echo off
@echo Deleting previous logs...
REM DEL *.log
@echo Applying the stylesheet...
@"C:\Program Files\Stylus Studio 6 XML Enterprise Edition\bin\stylusXslt" -in CISRI_Test_valid_v2_rpt.xml -XSLT SSDNSolution.xsl -out CISRI_Test_valid_v2_rpt_fmtd.xml 2> Stylesheet_OK.log
@if errorlevel 1 goto errorStylesheet
@echo Validating XML now...
@"C:\Program Files\Stylus Studio 6 XML Enterprise Edition\bin\StylusValidator" -schema "http://www.fsa.gov.uk/XMLSchema/FSATRSValidationReport-v1-0.xsd" CISRI_Test_valid_v2_rpt_fmtd.xml > Validation_OK.log
@if errorlevel 1 goto errorValidation
DEL Stylesheet_OK.log
@echo File validated successfully...
@goto ok
:errorStylesheet
REN Stylesheet_OK.log Stylesheet_Error.log
@echo Process failed during Stylesheet step...check Stylesheet log
@goto end
:errorValidation
@echo Process failed during Validation step...check Validation log
DEL Stylesheet_OK.log
REN Validation_OK.log Validation_Error.log
@goto end
:ok
@echo Processing complete
:end