final CommandLine parsedCommandLine = commandLineParser.parse(commandLineOptions, args);
/* If -xml specified, make sure -xsl is also. */
if (parsedCommandLine.hasOption("xml")
&& ! parsedCommandLine.hasOption("xsl")) {
throw new MissingOptionException("-xml switch requires -xsl switch, to specify the stylesheet");
}
/* If -xsl specified, make sure -xml is also. */
if (parsedCommandLine.hasOption("xsl")
&& ! parsedCommandLine.hasOption("xml")) {
throw new MissingOptionException("-xsl switch requires -xml switch, to specify the document");
}
return parsedCommandLine;
}