* @param outputFilePath Name of the output file to create.
*/
private void processFile(final String filePath, final String outputFilePath) {
log("Processing " + filePath);
try {
XMLInstance2Schema schemaGenerator = new XMLInstance2Schema();
if (_defaultGroupingAsAll) {
schemaGenerator.setDefaultGroupingAsAll();
}
Schema schema = schemaGenerator.createSchema(filePath);
String outputFileName = outputFilePath;
if (outputFileName == null) {
outputFileName = deriveOutputFilePath(filePath);
}
FileWriter dstWriter = new FileWriter(outputFileName);
schemaGenerator.serializeSchema(dstWriter, schema);
} catch (IOException e) {
throw new BuildException ("Problem writing to the given putput sink "
+ _xmlInstanceFile.getAbsolutePath(), e);
} catch (SAXException e) {
throw new BuildException ("Problem streaming the generated XML schema instance "