File hcFile = new File(packageDir, hcName);
options.addGeneratedFile(hcFile);
try {
IndentingWriter p =
new IndentingWriter(
new OutputStreamWriter(new FileOutputStream(hcFile)));
Transformer it = XmlUtil.newTransformer();
it.setOutputProperty(OutputKeys.METHOD, "xml");
it.setOutputProperty(OutputKeys.INDENT, "yes");
it.setOutputProperty(
"{http://xml.apache.org/xslt}indent-amount",
"2");
it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
it.transform( new DOMSource(hChains), new StreamResult(p) );
p.close();
} catch (Exception e) {
throw new GeneratorException(
"generator.nestedGeneratorError",
e);
}