// Load the stream into SDO
// We are just using SDO as a convenient way to parse the XML config file
HelperContext scope = SDOUtil.createHelperContext();
GenerateFactory.INSTANCE.register(scope);
XMLDocument xmlDoc = scope.getXMLHelper().load(fis);
GenerateType generateType = (GenerateType)xmlDoc.getRootObject();
// Get the file list. This is the list of XSD that is passed into the
// the velocity templates. Each configured file holds a list of types
// that the velocity templates expand into appropriate methods and method calls
List fileList = generateType.getInputFile();
//Initialise velocity ready to generate the various files
Properties p = new Properties();
p.setProperty("file.resource.loader.path", projectBuildDir + "/classes/generate");
Velocity.init(p);
VelocityContext context = new VelocityContext();
context.put("fileList", fileList);
List templateList = generateType.getTemplate();
// For each velocity template in the template list pass in the XSD file list
for ( Object item: templateList){
TemplateType template = (TemplateType)item;
context.put("template", template);