Dsmlv2Parser parser = new Dsmlv2Parser();
parser.setInput( new FileInputStream( dsmlFile ), "UTF-8" );
parser.parseAllRequests();
// Getting the batch request
BatchRequest batchRequest = parser.getBatchRequest();
// Creating a DSML batch response (only if needed)
BatchResponseDsml batchResponseDsml = null;
if ( responseFile != null )
{
batchResponseDsml = new BatchResponseDsml();
}
// Setting the errors counter
int errorsCount = 0;
// Creating a dummy monitor that will be used to check if something
// went wrong when executing the request
StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
// Processing each request
List<?> requests = batchRequest.getRequests();
for ( Object request : requests )
{
// Processing the request
processRequest( request, batchResponseDsml, dummyMonitor );